[SERVER-63892] Update namespace on acquiring locks for a collection using UUID during dropIndex Created: 22/Feb/22  Updated: 29/Oct/23  Resolved: 25/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Moustafa Maher Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2022-03-07
Participants:
Linked BF Score: 149

 Description   

While running dropIndex command:
1- We acquire the lock of the collection using namespace.
2- We take a copy of the collectionUUID & the namespace.
3- We release the lock of the collection because of (SERVER-46216).
4- We reacquire the lock of the collection using db and collectionUUID.
5- after that we hit some code paths that assert that the locks for the namespace should be acquired.

The issue happens when there is a concurrent renaming happening, so the namespace of the collection can be changed between step 3 & 4, so any code path that checks for the locks for the old namespace will fail.

Suggestions: 
1- To update the local copy of the namespace of the collection each time we reacquire the lock on step 4.

2- (Harder) to make sure that after we release the lock on step 3, we don't use the namespace and replace it with db & uuid.
 



 Comments   
Comment by Githook User [ 25/Feb/22 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-63892 Update namespace after dropping locks for `dropIndexes`
Branch: master
https://github.com/mongodb/mongo/commit/60bebe12f557f9126184f500dff8c8673ebd526a

Generated at Thu Feb 08 05:58:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.