[SERVER-15723] Avoid G_X lock for rename_collection within database Created: 19/Oct/14  Updated: 15/May/18  Resolved: 11/Jul/17

Status: Closed
Project: Core Server
Component/s: Concurrency, Storage
Affects Version/s: 2.7.7
Fix Version/s: 3.4.10, 3.5.10

Type: Bug Priority: Minor - P4
Reporter: Alvin Richards (Inactive) Assignee: Geert Bosch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-30037 Fix replset timeouts with collectionU... Closed
is depended on by SERVER-30087 convertToCapped should not yield lock... Closed
Documented
is documented by DOCS-10528 Docs for SERVER-15723: Avoid G_X lock... Closed
Related
is related to DOCS-10992 convertToCapped is missing the 'globa... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4
Sprint: Storage 2017-07-31
Participants:

 Description   

Probelm:

See https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/rename_collection.cpp#L113

            Lock::GlobalWrite globalWriteLock(txn->lockState());

Solution:
Scope this lock as a DB_X when renaming within a database. Renaming between databases probably still requires a G_X or perhaps two DB_X locks.



 Comments   
Comment by Ramon Fernandez Marina [ 12/Sep/17 ]

Author:

{'username': u'GeertBosch', 'name': u'Geert Bosch', 'email': u'geert@mongodb.com'}

Message:SERVER-15723 Avoid G_X lock for renameCollection within database

(cherry picked from commit 461d91da21c205a6a17476011c38fd4da246f592)

Conflicts:
src/mongo/db/catalog/rename_collection.cpp
Branch:v3.4
https://github.com/mongodb/mongo/commit/6b99d0f6e9bd94f9127b7c112c96d35356ad6e55

Comment by Githook User [ 11/Jul/17 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-15723 Avoid G_X lock for renameCollection within database
Branch: master
https://github.com/mongodb/mongo/commit/461d91da21c205a6a17476011c38fd4da246f592

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