Database system with methods for parallel lock management
First Claim
1. In a multi-tasking database system having a server storing a database connected to a plurality of clients, said database system providing a plurality of database engines for processing requests from the clients for database operations, an improved method for providing access to objects provided by the database system, the method comprising:
- providing each database engine with a lock manager for controlling access to objects in the database system;
storing lock management data structures which can be shared among all database engines, said lock management data structures storing locking information about a first plurality of locks that comprise a plurality of lock types for protecting access to objects in the database system which are shared;
controlling access to said lock management data structures through at least one hash table comprising a plurality of hash buckets, each hash bucket being associated with a particular lock type from said plurality of lock types provided by the system;
protecting access to said lock management data structures themselves with a second plurality of locks that comprise spin locks; and
providing parallel access to different ones of said first plurality of locks provided by the database system by associating each spin lock from said second plurality of locks with a particular group of hash buckets.
1 Assignment
0 Petitions
Accused Products
Abstract
Database system and methods are described for improving scalability of multi-user database systems by improving management of locks used in the system. The system provides multiple server engines, with each engine having a Parallel Lock Manager. More particularly, the Lock Manager decomposes the single spin lock traditionally employed to protect shared, global Lock Manager structures into multiple spin locks, each protecting individual hash buckets or groups of hash buckets which index into particular members of those structures. In this manner, contention for shared, global Lock Manager data structures is reduced, thereby improving the system'"'"'s scalability. Further, improved "deadlock" searching methodology is provided. Specifically, the system provides a "deferred" mode of deadlock detection. Here, a task simply goes to sleep on a lock; it does not initiate a deadlock search. At a later point in time, the task is awakened to carry out the deadlock search. Often, however, a task can be awakened with the requested lock being granted. In this manner, the "deferred" mode of deadlock detection allows the system to avoid deadlock detection for locks which are soon granted.
300 Citations
30 Claims
-
1. In a multi-tasking database system having a server storing a database connected to a plurality of clients, said database system providing a plurality of database engines for processing requests from the clients for database operations, an improved method for providing access to objects provided by the database system, the method comprising:
-
providing each database engine with a lock manager for controlling access to objects in the database system; storing lock management data structures which can be shared among all database engines, said lock management data structures storing locking information about a first plurality of locks that comprise a plurality of lock types for protecting access to objects in the database system which are shared; controlling access to said lock management data structures through at least one hash table comprising a plurality of hash buckets, each hash bucket being associated with a particular lock type from said plurality of lock types provided by the system; protecting access to said lock management data structures themselves with a second plurality of locks that comprise spin locks; and providing parallel access to different ones of said first plurality of locks provided by the database system by associating each spin lock from said second plurality of locks with a particular group of hash buckets. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)
-
-
21. In a multi-tasking database system, in which tasks may deadlock on one another while waiting for locks for accessing objects to be granted, said locks being created from a plurality of transactional lock types available in the system for protecting objects having shared access, an improved method of deadlock detection, the method comprising:
-
upon receiving a request from a certain task for a particular lock which can not yet be granted from said locks, placing the certain task to sleep while waiting for the particular lock to be granted; setting an alarm for periodically determining which task has been sleeping the longest on a lock; if the particular lock can be granted from said locks, awakening said certain task for continuing execution with access to the object controlled by the particular lock; and if the alarm triggers before the certain task has been granted the particular lock, awakening the certain task for undertaking deadlock detection. - View Dependent Claims (22, 23, 24, 25, 26, 27, 28, 29, 30)
-
Specification