-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
v4.2
-
Repl 2019-06-03, Repl 2019-06-17, Repl 2019-07-01, Repl 2019-07-15, Repl 2019-07-29
-
10
Currently, step down calls yieldLocksForPreparedTransactions by holding both RSTL and repl mutex lock. As a result, this can deadlock with prepared txn threads that have checked out the session. Consider the below case.
1) Thread A (txn cmd) has checked out the session.
2) Step down has acquired RSTL lock and repl mutex lock.
3) Step down calls yieldLocksForPreparedTransactions which marks the thread A as killed as it has checked out the session and its transaction state is TransactionState::kPrepared
4) Thread A tries to acquire repl mutex lock which is held by step down thread.
5) Step down waits for thread A to check in the session, so that it can check out the session and perform lock yielding of that prepared txn. But, thread A can't check in the session as it waiting for the repl mutex lock which is not interruptible.
SERVER-41317 describes a problem happened due to above scenario.
- related to
-
SERVER-41317 Push commitTransaction's check for a majority-committed prepare down into the TransactionParticipant
- Closed