Database Lock Release via Transaction Control Blocks
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional database systems face significant delays in resource availability due to multi-phase locking mechanisms, which require O(n+m) time for lock release, where n is the number of locks acquired and m is the number of waiting transactions, leading to inefficient resource allocation.
Innovation Solution
Implementing a system that associates transactions with transaction control blocks (TCBs) and uses a lock table to manage lock ownership and release, allowing locks to be released in constant time (O(1) by marking TCBs as 'released' and using a background thread for lock ownership transfer and memory reclamation, eliminating the need for acquired lock lists.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If multi-phase locking is used to enforce serializability, then transaction isolation and consistency are improved, but lock release time increases to O(n+m) where n is the number of locks and m is the number of waiting transactions
Solution Approach 1:
The patent segments the lock release operation into two independent parts: (1) marking the transaction's TCB as released in O(1) time, and (2) allowing waiting transactions to independently acquire locks from the lock table. This eliminates the sequential O(n+m) process of notifying each waiting transaction individually, while maintaining serializability through the lock table's ownership tracking.
Solution Approach 2:
The patent introduces a lock table as an intermediary data structure that decouples the lock owner from waiting transactions. The lock table stores lock ownership information and manages the queue of waiting transactions independently, allowing the releasing transaction to update its TCB status without directly interacting with each waiting transaction, thus achieving O(1) lock release time.
2Ease of operation
If acquired lock lists are maintained for each transaction, then lock tracking and release management are improved, but memory consumption increases
Solution Approach 1:
The patent extracts the lock tracking function from the transaction's acquired lock list and relocates it to the lock table. The lock table now maintains the mapping between locks and their owners, as well as the queue of waiting transactions. This eliminates the need for each transaction to maintain its own acquired lock list, reducing memory consumption while preserving lock management capabilities.
Solution Approach 2:
The lock table serves multiple functions: it tracks lock ownership, manages waiting transaction queues, and enables efficient lock release. By consolidating these functions into a single data structure, the patent eliminates redundant data storage in acquired lock lists while maintaining comprehensive lock management, thus reducing overall memory usage.
Data Source
AI summary
Implementations of the present disclosure include associating a first transaction executed within a database system with a first transaction control block (TCB) index, setting a status of the first transaction to active and a lock status of the first transaction to holding in response to a first set of locks being established for the first transaction, the first set of locks including one or more locks that each inhibit access to a respective resource within the database system, providing a lock table that records, for a set of locks within the database system, a set of lock owners including one or more transactions identified based on respective TCB indexes and a wait queue, and determining that the first transaction has completed, and in response setting the status of the first transaction to indicate completion of the transaction and the lock status of the first transaction to released.


