Priority Queue for Exclusive Locks in Database Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database systems face inefficiencies in managing concurrent lock requests, where a process waiting for a lock may expire due to prolonged waiting times, leading to unnecessary errors and delays, especially when multiple requests are made simultaneously or when a new request is more recent than an existing one.
Innovation Solution
Implementing a priority queue mechanism that manages lock requests by activating a queue for lock objects, allowing requests to be prioritized and ensuring that more recent requests are granted the lock efficiently, while expiring and removing unnecessary lock requests to prevent interminable waiting.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a fixed waiting time mechanism is used for lock requests, then processes can retry after a standardized interval, but more recent requests may be unfairly granted locks over older requests, causing inefficiency
Solution Approach 1:
The patent implements a dynamic priority queue system where lock requests are assigned priorities based on recency and other factors. The priority queue dynamically reorders requests, allowing the system to adapt to changing conditions and ensure that the most relevant requests are serviced first, resolving the contradiction between fairness and efficiency.
Solution Approach 2:
The system changes the parameter of request ordering from fixed temporal sequencing to priority-based sequencing. By introducing priority as a variable parameter that can be adjusted based on request characteristics, the system achieves both fairness (all requests are considered) and efficiency (appropriate requests are granted locks first).
2Reliability
If lock requests are held indefinitely in the queue, then all requests are eventually serviced, but processes experience interminable waiting times leading to errors and system inefficiency
Solution Approach 1:
The system performs preliminary actions by setting maximum wait time thresholds and priority levels before requests are fully processed. This allows the system to proactively expire low-priority or stale requests before they cause problems, ensuring that processes don't wait indefinitely while still giving reasonable requests a chance to be fulfilled.
Solution Approach 2:
The patent implements a mechanism to discard expired or low-priority lock requests from the queue when higher-priority requests are waiting. This prevents indefinite waiting by selectively removing requests that are no longer relevant, while the system can recover by allowing new requests to enter the queue and maintain overall lock management functionality.
Data Source
AI summary
A system includes reception of a first request for a lock on a lock object, storage of a first entry associated with the first request and the lock object in a queue, determination of a first queue position associated with the first entry based on a first priority level of the first request and on a priority level of each of a plurality of entries in the queue associated with the lock object, determination of whether a predetermined expiration time associated with the first request has expired, and, if it is determined that the predetermined expiration time has expired, deletion of the first entry from the queue.


