Incremental Optimistic Locking for Distributed Transaction Deadlock Avoidance

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering Contradiction Analysis

1Reliability

If traditional deadlock termination solutions are used, then deadlocked transactions can be terminated, but CPU and network usage increase significantly

Engineering Contradiction:
Improvedeadlock terminationVSAvoidCPU and network usage
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #9Preliminary anti-action

2Reliability

If traditional deadlock solutions are implemented, then transactions can be terminated, but processing time increases

Engineering Contradiction:
Improvetransaction terminationVSAvoidprocessing time
Core Design Contradiction:
ReliabilityVSLoss of time

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #22Blessing in disguise (Convert harm into benefit)

3Reliability

If pessimistic locking is used, then data consistency is maintained, but transaction throughput decreases

Engineering Contradiction:
Improvedata consistencyVSAvoidtransaction throughput
Core Design Contradiction:
ReliabilityVSProductivity

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.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS9104714B2Incremental optimistic locking of data distributed on multiple nodes to avoid transaction deadlock
Publication Date: 2015.08.11 RED HAT INC
  • US9104714B2 patent drawing
  • US9104714B2 patent drawing
  • US9104714B2 patent drawing

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.