[SERVER-61336] Relax mutex locks in FIleCopyBasedInitialSyncer Created: 09/Nov/21  Updated: 29/Oct/23  Resolved: 11/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0

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

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Replication 2021-11-15
Participants:

 Description   

Member variables in FileCopyBasedInitialSyncer may be accessed without a lock from within the main flow of control (regardless of the underlying executor thread), if they are only accessed from the main flow of control (should be annotated (X)). We have been locking more than that, which results in a deadlock when switching storage.

In particular, the class mutex should not be held while a database lock (i.e. global X) is held, regardless of order. This is because mutexes are not interruptible, so if a thread with an opCtx and no database locks blocks on the mutex, and we attempt to interrupt that opCtx as part of the storage change, there is a deadlock.



 Comments   
Comment by Githook User [ 10/Nov/21 ]

Author:

{'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}

Message: SERVER-61336 Relax mutex locks in FIleCopyBasedInitialSyncer
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/8671b18e47391055b9a443ae31930fddb59a6788

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