[SERVER-15715] find_and_modify appears to be taking a DB_X lock Created: 17/Oct/14  Updated: 11/Jul/16  Resolved: 05/Dec/14

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: 2.7.7
Fix Version/s: 2.8.0-rc3

Type: Bug Priority: Major - P3
Reporter: Alvin Richards (Inactive) Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-1117 don't use DBDirectClient in findAndMo... Closed
is duplicated by SERVER-18173 Being able to control the length of '... Closed
Related
related to SERVER-16469 findAndModify with sort exceeds inter... Closed
related to SERVER-16601 findAndModify should report that remo... Closed
related to SERVER-16063 Rewrite findAndModify Closed
Operating System: ALL
Participants:

 Description   

Problem:
https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/find_and_modify.cpp#L329

            Lock::DBLock dbXLock(txn->lockState(), dbname, MODE_X);

Solution:
Take a Collection level lock.



 Comments   
Comment by Githook User [ 05/Dec/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-15715 Remove the usage of DBDirectClient in findAndModify

This also removes the entire sort/no-sort branching and the usage of DB X
lock.
Branch: master
https://github.com/mongodb/mongo/commit/ac13fc6ab3ea3a3800ac494596acf2eb40beec72

Comment by Eliot Horowitz (Inactive) [ 18/Oct/14 ]

Can easy and safely be moved to collection MODE_X, at the very least we should do that.
Pretty sure its safe anyway with any transactional engine.

Comment by Geert Bosch [ 17/Oct/14 ]

This was in my original CLL patch, but got taken out during review because of concerns about safety. Needs more auditing.

Comment by Daniel Pasette (Inactive) [ 17/Oct/14 ]

depends on deadlock detection work

Generated at Thu Feb 08 03:38:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.