Incremental Optimistic Locking for Distributed Transaction Deadlock Avoidance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional solutions for transaction deadlock in distributed data systems are costly and inefficient, as they often require significant CPU and network usage to terminate deadlocked transactions, which can lead to prolonged waiting periods and data inconsistency.
Innovation Solution
Implementing incremental optimistic locking by determining a lock order for transactions to acquire locks sequentially on distributed nodes, ensuring that transactions attempting to update the same data use the same first enlisted node, thereby avoiding deadlocks and reducing processing time.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional deadlock termination solutions are used, then deadlocked transactions can be terminated, but CPU and network usage increase significantly
Solution Approach 1:
The patent applies preliminary action by establishing a predefined lock acquisition order before deadlocks occur. Each transaction must acquire locks in the predetermined sequence (e.g., Data-A then Data-B), which prevents circular wait conditions and eliminates deadlocks before they can form, avoiding the need for costly deadlock detection and termination operations.
Solution Approach 2:
The patent implements preliminary anti-action by proactively preventing deadlock conditions through the lock ordering mechanism. By ensuring all transactions follow the same lock acquisition sequence, the system counteracts the potential for circular waits and resource holding dilemmas that lead to deadlocks, thereby eliminating the need for reactive termination solutions.
2Reliability
If traditional deadlock solutions are implemented, then transactions can be terminated, but processing time increases
Solution Approach 1:
The system performs preliminary action by pre-establishing the lock acquisition sequence, which prevents deadlocks from forming in the first place. This eliminates the time-consuming processes of deadlock detection, dependency graph construction, and transaction termination that would otherwise be required when deadlocks occur.
Solution Approach 2:
The patent converts the potential harm of deadlock conditions into a benefit by using the lock ordering rule to guarantee progress. The predetermined order ensures that transactions can always acquire locks in a consistent manner, transforming what would be a harmful circular wait condition into a beneficial deterministic execution sequence that improves processing efficiency.
3Reliability
If pessimistic locking is used, then data consistency is maintained, but transaction throughput decreases
Solution Approach 1:
The patent applies local quality by implementing different locking strategies at different stages of the transaction process. During the execution phase, a predetermined lock order is used to prevent deadlocks while allowing concurrent access. The locking mechanism adapts its behavior based on the transaction state, using optimistic assumptions during preparation and switching to ordered locking only when necessary, thereby maintaining both consistency and throughput.
Data Source
AI summary
A transaction originator node identifies multiple data elements distributed at multiple enlisted nodes to lock for a transaction managed by the transaction originator node. The transaction originator node determines which of the enlisted nodes is a first enlisted node in a lock order for the transaction and sends an update request to the first enlisted node in the lock order to lock a data element residing at the first enlisted node. The transaction originator node sends update requests to remaining enlisted nodes in the lock order to cache the update requests until the remaining enlisted nodes receive a message to perform a lock.


