Distributed Lock Sharding for Deadlock Visibility and Scaling
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Distributed locking systems in computing environments lack visibility into deadlocks and are not scalable, leading to inefficiencies and performance issues.
Innovation Solution
Implement a distributed locking system using a set of share-nothing databases with a two-phase commit protocol, enabling deadlock detection and traceability, and allowing for on-demand scaling while maintaining lock consistency and fairness.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If a distributed locking system is implemented to manage coordination across multiple machines, then lock management capability is improved, but visibility into deadlocks and lock contention issues deteriorates
Solution Approach 1:
The patent implements a feedback mechanism by having the locking system publish lock information to a monitoring system. The monitoring system receives lock requests, lock releases, and lock status updates, enabling continuous observation and detection of deadlocks and contention issues without interfering with the distributed locking operations.
Solution Approach 2:
The patent introduces a monitoring system as an intermediary component between the distributed locking system and the users/developers. This intermediary captures lock information from the locking system and provides visibility into lock contention and deadlocks through a separate observation channel, resolving the contradiction between maintaining lock management simplicity and providing detection capability.
2Adaptability or versatility
If a distributed locking system is implemented to support multiple processes, then coordination capability is improved, but system complexity deteriorates
Solution Approach 1:
The patent segments the system into two independent parts: the distributed locking system that handles coordination, and the monitoring system that handles observation. This segmentation allows each component to remain simple while the composite system provides both coordination and monitoring capabilities. The locking system focuses solely on lock management, while the monitoring system focuses solely on observing and reporting lock information.
3Reliability
If a locking service is implemented to ensure atomic operations and lock fairness, then reliability is improved, but scalability deteriorates
Solution Approach 1:
The monitoring system acts as an intermediary that observes lock operations without interfering with the locking service's operation. This allows the locking service to maintain its reliability and fairness properties while the monitoring system independently provides scalability for observation and analysis. The two systems operate independently, avoiding the scalability constraints that would result from combining monitoring functionality directly into the locking service.
Data Source
AI summary
Executing distributed locks in a system having resources adapted to be accessible by processes that are being executed, the method being executed by a locking system logically independent of the processes, by: receiving from a process a lock request including a name of a resource to place a lock on; determining a shard key based on the lock name and a prefix value, wherein the locking system includes a set of database instances, the prefix value based on a number of database instances currently employed in the locking system; sending the lock request to at least two database instances to place the lock in an entry pointed to by the shard key; transmitting a message to the process requesting the lock that the lock can be acquired when all database instances acknowledge the lock request; and dismissing the lock request when a database instance cannot acknowledge the lock request.


