[SERVER-30087] convertToCapped should not yield locks before renaming Created: 11/Jul/17  Updated: 30/Oct/23  Resolved: 11/Jul/17

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.5.9
Fix Version/s: 3.5.10

Type: Bug Priority: Major - P3
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-15723 Avoid G_X lock for rename_collection ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage 2017-07-31
Participants:
Linked BF Score: 0

 Description   

Since SERVER-29904, the convertToCapped uses mongo::renameCollection rather than directly calling the Database::renameCollection. As mongo::renameCollection takes a global lock, and convertToCapped only takes a global lock, we'd unlock before doing the final rename. However this caused a race condition when multiple concurrent convertToCapped operations are in progress. After SERVER-15723, we can call mongo::renameCollection while holding the database lock, thus fixing this issue.



 Comments   
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-30087 convertToCapped should not yield locks before renaming
Branch: master
https://github.com/mongodb/mongo/commit/48b88e8345b109889650b7dd510df916a94550df

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