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

Implement WT_SESSSION::prepare_transaction

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.4, 3.7.3, WT3.1.0
    • Component/s: None
    • Labels:
      None

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: