-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
Storage NYC 2019-05-20, Execution Team 2019-06-03
Currently there can be 3 way deadlock if step up doesn’t wait for index build to complete for the below scenario:
- Node is in secondary and it starts the index build in back background process in runWithoutInterruptionExceptAtGlobalShutdown . Let's say the index build’s plan executor currently yielded the lock.
- Step up will be able to acquire the RSTL lock in mode X and finish completing its step up process.
- Now, the node is in primary and index build would be able to be blocked by prepared txn due to prepare conflict. (Note: On secondaries, we have the prevention mechanism to block transactions from being prepared if the index build is in progress. So, step up/ rollback which takes X lock and doesn’t kill operations wouldn’t get into 3 way deadlock issues).
- Node tries to step down which will be blocked behind index. As the step down couldn’t kill index build for 2 reasons 1) connection is internal 2) index build is running w/ interrupt guard (runWithoutInterruptionExceptAtGlobalShutdown).
- CommitTransaction cmd is waiting for RSTL lock to acquire in IX mode but blocked behind the step down thread.
This ticket has to implement such that step up will wait for background process (index build) to complete after it has acquired the RSTL lock in X mode but released the repl mutex lock.( like we do it in rollback).
- is depended on by
-
SERVER-41034 Invariant if we get a prepare conflict inside runWithoutInterruptionExceptAtGlobalShutdown block.
- Closed
- is related to
-
SERVER-40700 Deadlock between read prepare conflicts and state transitions
- Closed
-
SERVER-44577 Ensure WiredTiger cursors have started a transaction before reading data
- Closed
-
SERVER-41462 do not lock RSTL for uninterruptible index lock operations
- Closed
-
SERVER-44045 allow secondary index builds to start without unlocking the RSTL
- Closed