[SERVER-48152] renameCollectionAndDropTarget() should check for background operations before calling preRenameCollection() Created: 12/May/20  Updated: 29/Oct/23  Resolved: 12/May/20

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 4.4.0-rc6, 4.7.0

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

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-05-18
Participants:
Linked BF Score: 38

 Description   

This is related to a build failure on non-document level locking storage engines.

The call to OpObserver::preRenameCollection here will get the locks on the Oplog and maintain them during the duration of the WriteUnitOfWork. The check for assertNoIndexBuildInProgForCollection() requires the IndexBuildsCoordinator _mutex. But if we have an operation that is already holding the _mutex and is waiting for the Oplog locks, we will deadlock.

To solve this, we should check for background operations prior to calling preRenameCollection().



 Comments   
Comment by Githook User [ 12/May/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-48152 renameCollectionAndDropTarget() should check for background operations before calling preRenameCollection()

(cherry picked from commit c4c5768798b72027a7b40eb0bbf4455f7e9564b9)
Branch: v4.4
https://github.com/mongodb/mongo/commit/56b6e3132abf3f9efdb579081053b083323790de

Comment by Githook User [ 12/May/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-48152 renameCollectionAndDropTarget() should check for background operations before calling preRenameCollection()
Branch: master
https://github.com/mongodb/mongo/commit/c4c5768798b72027a7b40eb0bbf4455f7e9564b9

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