Consider the following sequence,
1) Start an index build on collection A on primary.
2) Prepare the transaction on collection A.
3) Index build gets aborted can be possibly due to some killOp cmd or due to some key constraint errors.
4) As a result of index build failure, it tries to do the cleanup phase. Assume, it's here. So, index build thread has acquired RSTL in mode IX and the uninterruptible lock guard is enabled.
5) Now, assumed stepDown cmd comes in. So, it's going to enqueue the RSTL in mode X. But, blocked behind the index build thread.
6) Now, the index builder thread tries to acquire collection lock in X mode to write the abortIndexBuild oplog entry and to tear down the index build. But this step, gets blocked behind prepared transaction due to collection lock conflict.
7) Prepared transaction's commit command blocks behind the step down thread.
- depends on
-
SERVER-46560 Make Abort index build logic deterministic.
- Closed
- is related to
-
SERVER-45921 Index builder invariants on this check (indexSpecs.size() > 1) while trying to start building index.
- Closed