Distributed Transaction Writer Lock Management
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In distributed transaction processing, existing systems face challenges in avoiding collision problems and ensuring transaction isolation and consistency, particularly in multi-transaction concurrency scenarios.
Innovation Solution
A method and device for processing distributed transactions that involve acquiring and managing writer locks on target tables, distributing lock requests across multiple nodes, and handling non-responsive nodes by restarting or migrating services, ensuring successful locking and maintaining locking state information to prevent collisions and ensure consistency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If writer lock adding processing is performed on the target table to ensure transaction isolation, then transaction consistency is improved, but system collision problems occur in multi-transaction concurrency
Solution Approach 1:
The patent segments the target table into multiple partitions and distributes writer locks across different partitions. Each partition can be locked independently, allowing concurrent transactions to access different partitions simultaneously. This segmentation reduces system-wide collisions while maintaining transaction isolation and consistency within each partition.
Solution Approach 2:
The patent implements fine-grained locking at the partition level rather than table-level locking. Each partition has its own lock state, enabling local quality control where only the specific partition being modified is locked. This allows other partitions to remain accessible to concurrent transactions, improving productivity while maintaining reliability.
2Productivity
If writer locks are distributed across multiple nodes to improve system efficiency, then processing capability is improved, but lock management complexity increases
Solution Approach 1:
The patent introduces a coordinator node as an intermediary that manages writer lock distribution across multiple worker nodes. The coordinator receives lock requests, determines which partitions need locking, and coordinates the locking process across nodes. This intermediary approach simplifies lock management complexity by centralizing coordination while enabling distributed processing capability.
Solution Approach 2:
The patent performs preliminary lock acquisition before transaction execution. The system pre-identifies which partitions will be modified and acquires locks on those partitions in advance. This preliminary action reduces lock management complexity during transaction execution and improves processing capability by avoiding lock contention during actual data operations.
3Reliability
If non-responsive child nodes are restarted to maintain system reliability, then system stability is improved, but service interruption time increases
Solution Approach 1:
The patent implements self-service mechanisms where child nodes automatically detect their own non-responsive state and trigger self-restart procedures. The system monitors node health and enables automatic recovery without manual intervention. This self-service approach improves system stability while minimizing service interruption time by initiating recovery actions immediately when failures are detected.
Solution Approach 2:
The patent implements health monitoring and early warning mechanisms that detect node degradation before complete failure. The system prepares recovery strategies in advance and can perform graceful degradation or load redistribution before a node completely fails. This beforehand cushioning reduces service interruption time by preventing catastrophic failures and enabling proactive recovery.
4Measurement precision
If version information is sent to SQL compiler after successful locking, then transaction accuracy is improved, but communication overhead increases
Solution Approach 1:
The patent merges version information transmission with the lock acquisition process. Instead of separate communication steps, the system combines lock request and version information delivery into a single communication exchange. This merging reduces communication overhead while maintaining transaction accuracy by ensuring the SQL compiler receives both the lock confirmation and version data in one interaction.
Solution Approach 2:
The patent implements feedback mechanisms where the SQL compiler sends version information requests only when needed for specific transactions. The system provides selective feedback about version information based on actual transaction requirements rather than universally transmitting all version data. This feedback approach reduces communication overhead while maintaining transaction accuracy by delivering precise version information only when necessary.
Data Source
AI summary
An objective of the present application is to provide a method and device for processing a distributed transaction. Compared with the prior art, in a distributed system, a first device in the present application is a group formed by multiple nodes. The first device acquires a writer lock adding request, sent by an SQL compiler, about a target table of a to-be-processed transaction, and performs writer lock adding processing on the target table on the basis of the writer lock adding request, so as to avoid collision problems in multi-transaction concurrence and to ensure isolation of transactions. If the writer lock adding processing is successful, to-be-processed version information of the target table is sent to the SQL compiler, so as to ensure that the SQL compiler operates a correct version of the target table later. Further, by restarting child nodes which do not respond to the writer lock adding request or migrating service of the child nodes to other physical machines and then updating locking state information of the child nodes, the present application effectively recovers errors and ensures in-group consistency.


