Distributed Transaction Commit Outcome Determination
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing global transaction protocols, such as the XA protocol, are ambiguous in determining the outcome of transactions when communication errors or timeouts occur, leading to user frustration, duplicate submissions, and incorrect reporting of commit outcomes.
Innovation Solution
The solution involves switching control and management between the transaction manager (TM) and the database management system (DBMS) to determine the outcome of commands, using techniques like one-phase commit and promotable global transactions, and employing logical transaction handles (LTXIDs) to ensure idempotence and accurate commit outcome reporting.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional two-phase commit protocol is used, then transaction atomicity is ensured, but commit outcome determination becomes ambiguous when communication errors occur
Solution Approach 1:
The system performs preliminary recording of commit outcomes in durable storage before the transaction manager needs to report them. When a resource manager commits a transaction, it immediately records the outcome in a durable format (such as a transaction log or database), ensuring the information persists even if communication fails. This preliminary action eliminates the ambiguity of commit outcomes during communication errors.
2Speed
If communication timeout is implemented, then system responsiveness is improved, but transaction outcome determination becomes uncertain
Solution Approach 1:
The system introduces an intermediary durable storage mechanism (such as a transaction log or outcome registry) that mediates between the resource manager and transaction manager. When communication timeouts occur, the transaction manager can query this intermediary storage to determine the actual commit outcome, rather than relying solely on timeout-based assumptions. This intermediary preserves reliable outcome determination while allowing responsive timeout handling.
3Reliability
If retry mechanism is implemented, then system robustness is improved, but logical corruption risk increases due to duplicate submissions
Solution Approach 1:
The system implements a feedback mechanism where the transaction manager queries durable stored commit outcomes before retrying transactions. The durable storage provides feedback about whether a transaction was actually committed, allowing the system to make informed retry decisions. This feedback prevents duplicate submissions by confirming the actual outcome, maintaining system robustness while avoiding logical corruption.
Solution Approach 2:
The system performs preliminary verification of commit outcomes from durable storage before allowing retry operations. By checking the stored outcome in advance, the system determines whether a retry is actually necessary, preventing duplicate submissions while maintaining robustness through informed retry decisions.
4Loss of information
If session state is maintained, then transaction tracking is improved, but system complexity increases during communication failures
Solution Approach 1:
The system extracts commit outcome information from volatile session state and stores it in durable storage. This extraction removes the burden of maintaining transaction outcome information in memory during communication failures, simplifying session management while preserving complete transaction tracking information in the durable storage system.
Data Source
Figure 1A
Figure 1B
Figure 2
AI summary
Techniques are described for providing a guaranteed commit outcome for global transactions that are optimized by deferring the commit processing to a resource manager, such as a DBMS, using optimizations. The "Distributed Transaction Processing: The XA Specification" standard specification is ambiguous regarding commit outcomes for transactions managed by DBMS, resulting in wrong results for vendors implementing the standard. The techniques described provide a guaranteed commit outcome when using the optimizations, creating the opportunity for safe replay of global transactions when a communication error or timeout occurs between the transaction manager and the resource manager, and eliminating ambiguous transaction outcomes reaching applications and end users.