|
prepare:
If something throws an exception before prepare completes, the abort guard will get triggered and abort the transaction.
commit prepared:
After the sanity checks, the entire block is wrapped in a try catch block that terminates if it catches any exception.
|
|
As of 02a532609f5e4b5c7cde64a4f0444cb5dc0dcb3e.
abort command:
Update to config.transactions occur at opObserver onTransactionAbort, while TransactionParticipant mutex is released. The TxnParticipant in memory lastWriteTS gets updated during the RecoveryUnit (of the config.transaction update) onCommit callback, also while TxnParticipant mutex is released. However, session is still checked out, so no other thread (like migration, TxnRepaer) can modify the TxnParticipant. It then grabs the mutex again and tries to set the TxnParticipant state to abort. In between the config.txn update and TxnParticipant update, there are no non-fatal early returns that would leave the TxnParticipant usable but out-of-sync.
|