Add a WT_UPDATE prepared state that will be applied to all updates belonging to a transaction when the WT_SESSION::prepare_transaction API is called.
- A new member ‘state’ will be added to update structure. The possible value are WT_UPDATE_NONE, WT_UPDATE_PREPARE, WT_UPDATE_LOCKED.
- This state member will be used to manage the state transition of update structure.
- When WT_SESSION::prepare_transaction is called:
For all updates in the update list
Set timestamp for all updates as prepare timestamp.
Mark state as WT_UPDATE_PREPARE.
Remove transaction IDs from the transaction table so its updates are seen and WT_PREPARE_CONFLICT will be returned for other sessions.
Error on any valid update structures for the same key that are at a later timestamp.
- During WT_SESSION::rollback_transaction
For all updates in update list
Set txnid of update structure to WT_TXN_ABORTED.
During WT_SESSION::commit_transaction
For all updates in the update list
change state from ‘WT_UPDATE_PREPARE’ → ‘WT_UPDATE_LOCKED’.
Set timestamp of updates as commit_timestamp.
Change state from ‘WT_UPDATE_LOCKED’ → ‘WT_UPDATE_NONE’.
Set txnid of update structure to WT_TXN_NONE
- is depended on by
-
WT-3913 Enhance cursor operations to account for prepare state
- Closed