There will be special logic required for rollback since updates to the systems.transaction won't have any oplog entries and won't be rolled back to the right state.
This can be resolved by:
Approach1: copying the full table from the sync source as part of the rollback process. This should be done before the minValid opTime is determined and set. Cons: Can be expensive since there can be many documents that needs to be copied over (one doc per statement)
Approach2: Remove the corresponding transaction statement entries from transaction table (both in-memory cache and storage) by inspecting the (sessionId, txnNum and stmtId) of the oplog entry. Cons: Cannot revert state back to older transactions in a session.
- is related to
-
SERVER-29933 Roll Back to Checkpoint: Notify subsystems that rely on OpObservers to maintain state to rebuild state from data on disk
- Closed
- related to
-
SERVER-37811 Replication rollback invalidates all sessions with retryable writes, not just the rolled-back ones
- Backlog