States of the transaction for two-phase commitment control

 

A commitment definition is established at each location that is part of the transaction program network. For each commitment definition, the system keeps track of the state of its current transaction and previous transaction.

The system uses the state to decide whether to commit or roll back if a transaction is interrupted by a communication or system failure. If multiple locations are participating in a transaction, the states of the transactions at each location might be compared to determine the correct action (commit or rollback). This process of communicating between locations to determine the correct action is called resynchronization.

The following table shows these items:

State name Description Resynchronization if the transaction is interrupted Action taken by a communications or system failure
Basic states during two-phase commit processing:
Reset (RST) From the commitment boundary until a program issues a request to commit or roll back. Not needed. Pending changes are rolled back.
Prepare in Progress (PIP) The initiator has started the prepare wave. All locations have not yet voted. May be necessary. Pending changes are rolled back.
Prepared (PRP) This location and all locations further down in the transaction program network have voted to commit. This location has not yet received notification from the initiator to commit. Required. In doubt. It depends on the results of the resynchronization process.
Commit in Progress (CIP) All locations have voted to commit. The initiator has started the committed wave. Required. Pending changes are committed. Resynchronization is performed to ensure that all locations have committed. If a heuristic rollback is reported by another location, an error is reported.
Committed (CMT) All agents have committed and returned a reply to this node. May be necessary. None.
Additional states during two-phase commit processing:
Last Agent Pending (LAP) If a last agent is selected, this state occurs at the initiator between the PIP state and the CIP state. The initiator has instructed the last agent to commit and has not yet received a response. Required. In doubt. It depends on the results of the resynchronization process.
Vote-Read-Only (VRO) This agent responded to the prepare wave by indicating that it has no pending changes. If the vote-read-only state is permitted, this agent is not included in the committed wave. May be necessary. None.
Rollback Required (RBR) One of the following events occurred:

  • An agent issued a rollback request before the commit operation.

  • A transaction failure has occurred.

  • The QTNRBRQD API was used to place the transaction in a rollback required state.
The transaction program is not allowed to perform any additional changes under commitment control.
May be necessary. Pending changes are rolled back.
Conditions that occur because of operator actions or errors:
Forced Rollback This location and all locations further down the transaction program network, except the last agent, have been rolled back through operator intervention. May be necessary. Pending changes have already been rolled back.
Forced Commit This location and all locations further down the transaction program network, except the last agent, have committed through operator intervention. May be necessary. Pending changes have already been committed.
Heuristic Mixed (HRM) Some resource managers have committed. Some have rolled back. Operator intervention was used or a system error occurred. Heuristic mixed does not appear as a status on the commitment definition displays. Notification messages are sent to the operator. May be necessary. The operator must perform a restore operation at all participating locations to bring the database to a consistent state.

 

Parent topic:

Two-phase commitment control

 

Related concepts


Commitment definition for two-phase commit: Allow vote read-only
Commitment definition for two-phase commit: Not wait for outcome
Starting commitment control
Commitment control recovery during initial program load after abnormal end
Commitment control errors