Primary aborts the split-prepared transactions before it reserves the abort oplog entry. This is a bug as it violates the assumption noted in the comment.
This bug would enable a sequence like the following - Let's say we have Txn1 and Txn2 that write to the same set of documents:
1. Txn1 is split and prepared on a node when the node was a secondary
2. The node steps up as a primary
3. The node aborts Txn1's split prepared transaction
4. Now, the node is able to prepare Txn2 with prepareOptime T1 since Txn1 is effectively aborted
5. The node reserves and writes abort oplog entry for Txn1 with optime T2
In this case, secondaries would see prepare of Txn2 before abort of Txn1, resulting in prepare conflicts when applying Txn2.
- is related to
-
SERVER-76774 Invariant that secondary oplog application doesn't get prepare conflicts
- Closed
- related to
-
SERVER-35863 Write an abortTransaction oplog entry if a transaction that may have written a prepare oplog entry aborts
- Closed