Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
-
Replication 2021-11-15
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.