Weak Exclusive Locks for Database Read-Write Concurrency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing lock management approaches in distributed systems face challenges with impeded read-write concurrency, particularly in database server clusters where numerous entities hold share locks, leading to delays when converting these locks to exclusive locks, as the system must wait for acknowledgments from all share lock holders before granting an exclusive lock.
Innovation Solution
Introduce the concept of weak exclusive locks, which allow entities to modify a resource without making a separate copy and without waiting for a strong exclusive lock, by granting permission to perform changes on a copy of the resource while ensuring changes remain temporary until a strong exclusive lock is granted, thereby reducing the delay between requesting and making changes permanent.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the system waits for acknowledgments from all share lock holders before granting an exclusive lock, then data consistency is ensured, but read-write concurrency is impeded and delay increases
Solution Approach 1:
The system performs preliminary actions by notifying share lock holders in advance that an exclusive lock is being granted, allowing them to prepare for the upcoming state change. This advance notification reduces the waiting time for the exclusive lock while still maintaining data consistency through the acknowledgment mechanism.
Solution Approach 2:
The patent implements asynchronous acknowledgment collection, where the lock granting process continues without being blocked by synchronous waits for all share lock holders. The system initiates the exclusive lock grant and continues with other operations while simultaneously collecting acknowledgments in the background, ensuring continuous useful action rather than idle waiting.
2Productivity
If the system grants strong exclusive lock before modifications are complete, then permission to modify is obtained, but data consistency may be compromised if failures occur
Solution Approach 1:
The system prepares the exclusive lock state in advance as a cushioning mechanism, but includes safeguards through asynchronous acknowledgment collection and rollback capabilities. This allows the system to grant permission for modifications quickly while having protective measures in place to revert changes if acknowledgments fail or errors occur, thus cushioning against potential data consistency issues.
3Loss of time
If asynchronous notification and acknowledgment collection is implemented, then delay is reduced, but system complexity increases
Solution Approach 1:
The patent introduces an intermediary asynchronous notification mechanism that mediates between the lock manager and share lock holders. This intermediary layer handles the complexity of asynchronous communication, acknowledgment tracking, and coordination, shielding the core lock management logic from complexity while enabling reduced delays through non-blocking operations.
Data Source
AI summary
Techniques are provided for performing changes to a resource governed by a locking mechanism. An entity (such as a server instance in a database system cluster) requests permission to modify the resource. In response to the request, the entity receives a first lock on the resource, which grants permission to perform the change to the resource without making the change permanent. After receiving the first lock, the entity performs the change to a copy of the resource that resides in shared memory without making another copy of the resource. After performing the change and until receiving permission to make the change permanent, the entity prevents the change to the resource from becoming permanent. After performing the change, the entity receives a second lock on the resource, which grants the entity permission to make the change permanent. After receiving the second lock, the entity ceases to prevent the change to the resource from becoming permanent.


