-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
RSS Sydney
-
Fully Compatible
-
GregsList - 2024-09-03, PopcornChicken - 2024-09-17
WiredTigerKVEngine::beginNonBlockingBackup acquires _oplogPinnedByBackupMutex before acquiring _wtBackup.wtBackupDupCursorMutex (see here).
But WiredTigerKVEngine::endNonBlockingBackup acquires these mutexes in the inverted order: https://github.com/10gen/mongo/blob/16f711ffff54f0cf019efda3dc7796c39f7fe615/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp#L1365-L1369.
Both of these functions acquire _wtBackup.wtBackupCursorMutex first/before either of these mutexes, so there isn't a real deadlock today. But it makes the code hard to reason about, bug-prone in the future, and requires a TSAN suppression to run without these locks having a clear ordering.
- related to
-
SERVER-88159 mongo::Mutex masks TSAN's ability to detect a lock order inversion
- Closed