-
Type: Task
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Replication
-
Fully Compatible
-
Storage NYC 2019-05-06, Storage NYC 2019-05-20
Prepared transactions hold collection and database IX locks across state transitions, and can only release those locks by processing a 'commitTransaction' or 'abortTransaction' command. It is very possible that in order to receive a 'commitTransaction' or 'abortTransaction' command, a node must go through a state transition to step up or down. Thus we cannot just wait for the prepared transaction to release its locks to acquire locks for the state transition.
This means that state transitions cannot acquire locks that would conflict with locks held by a prepared transaction.
The only state transition that I know of that acquires locks is step-up.
Shutdown does not count as a state transition. It aborts all prepared storage transactions without making that abort durable in any way before acquiring any locks. This occurs after shutting down the replication system (though before killing all operations), so I think it should be safe.
- depends on
-
SERVER-37987 Use finer grained locks for on step up reads and writes
- Closed
-
SERVER-38139 Ban temporary collections in prepared transactions
- Closed
-
SERVER-38140 Only acquire a Database IX lock for replicated collection drops
- Closed
-
SERVER-39520 Only use collection MODE_X locks for collection drops
- Closed
- is related to
-
SERVER-35365 MapReduce temporary inc collections should be written to the local database
- Closed
-
SERVER-37199 Yield locks of transactions in secondary application
- Closed
-
SERVER-41037 Stepup should kill all user operations(that encounters prepare conflict) before taking RSTL lock in X.
- Closed
- related to
-
SERVER-40700 Deadlock between read prepare conflicts and state transitions
- Closed
-
SERVER-40723 Deadlock between S lock acquisition on secondary and prepare conflict
- Closed
-
SERVER-37381 Allow prepared transactions to survive state transitions
- Closed