[SERVER-15826] ConvertToCapped appears to be taking a G_X lock Created: 27/Oct/14  Updated: 02/Aug/18  Resolved: 03/Dec/14

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: 2.8.0-rc0
Fix Version/s: 2.8.0-rc2

Type: Task 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:
Related
related to DOCS-4502 Remove 'global write lock' mention fr... Closed
is related to DOCS-10992 convertToCapped is missing the 'globa... Closed
Tested
Participants:

 Description   

Problem

https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/collection_to_capped.cpp#L217

            // calls renamecollection which does a global lock, so we must too:
            //
            Lock::GlobalWrite globalWriteLock(txn->lockState());
            Client::Context ctx(txn, dbname);

Per SERVER-15723, the lock taken for renameCollection may change, therefore this command should

  • match any change made to renameCollection
  • this probably only needs to be DB_X lock because convertToCapped does not take a namespace parameter


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

Author:

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

Message: SERVER-15826 convertToCapped doesn't need to take a global lock
Branch: master
https://github.com/mongodb/mongo/commit/f423ad99311088658c7aabb1d94ee29137896b90

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