Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-3850

Implement WT_SESSSION::prepare_transaction

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.4, 3.7.3, WT3.1.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage 2018-01-29, Storage 2018-02-12, Storage 2018-02-26

      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

            Assignee:
            vamsi.krishna@mongodb.com Vamsi Boyapati
            Reporter:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: