Lock management method in cluster, lock server, and client
First Claim
Patent Images
1. A lock server comprising:
- a memory configured to;
store a read lock request queue, wherein the read lock request queue records an identifier of a client that is in a client cluster and is either in a read lock waiting state or obtaining a read lock for a shared resource, and wherein the read lock request queue further records a write lock allocation identifier indicating whether a write lock for the shared resource is allocated; and
store a read lock allocation count indicating a quantity of read locks allocated for the shared resource; and
an interface card coupled to the memory and configured to;
receive, from a first client in the client cluster, a first read lock request carrying an identifier of the first client and carrying a first memory address in the read lock request queue;
write the identifier of the first client into the first memory address;
increase the read lock allocation count according to a quantity of read locks allocated to the first client when the write lock allocation identifier indicates that the write lock is not allocated; and
send, to the first client, a first message carrying the write lock allocation identifier and indicating that the first client obtains the read lock.
1 Assignment
0 Petitions
Accused Products
Abstract
A lock management solution in a cluster, where the cluster includes a client and a lock server, the lock server includes an interface card and a memory, the memory stores a read lock request queue recording an identifier of a client waiting for a read lock or obtaining the read lock, the memory further stores a write lock request queue recording an identifier of a client waiting for a write lock or obtains the write lock, and the memory further includes a read lock allocation count and a write lock allocation identifier, where the read lock allocation count records an allocated read lock, and the write lock allocation identifier indicates whether the write lock has been allocated.
25 Citations
20 Claims
-
1. A lock server comprising:
-
a memory configured to; store a read lock request queue, wherein the read lock request queue records an identifier of a client that is in a client cluster and is either in a read lock waiting state or obtaining a read lock for a shared resource, and wherein the read lock request queue further records a write lock allocation identifier indicating whether a write lock for the shared resource is allocated; and store a read lock allocation count indicating a quantity of read locks allocated for the shared resource; and an interface card coupled to the memory and configured to; receive, from a first client in the client cluster, a first read lock request carrying an identifier of the first client and carrying a first memory address in the read lock request queue; write the identifier of the first client into the first memory address; increase the read lock allocation count according to a quantity of read locks allocated to the first client when the write lock allocation identifier indicates that the write lock is not allocated; and send, to the first client, a first message carrying the write lock allocation identifier and indicating that the first client obtains the read lock. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A lock management method comprising:
-
storing, by a memory of a lock server, a read lock request queue, wherein the read lock request queue records an identifier of a client that is in a client cluster and is either in a read lock waiting state or that-is-obtaining a read lock for a shared resource, and wherein the read lock request queue further records a write lock allocation identifier indicating whether a write lock for the shared resource is allocated; storing, by the memory, a read lock allocation count indicating a quantity of read locks allocated for the shared resource; receiving, by an interface card of the lock server and from a first client in the client cluster, a first read lock request carrying an identifier of the first client and carrying a first memory address in the read lock request queue; writing, by the interface card, the identifier of the first client into the first memory address; increasing, by the interface card, the read lock allocation count according to a quantity of read locks allocated to the first client when the write lock allocation identifier indicates that the write lock is not allocated; and sending, by the interface card and to the first client, a first message carrying the write lock allocation identifier and indicating that the first client obtains the read lock. - View Dependent Claims (8, 9, 10, 11)
-
-
12. A computer program product comprising computer-executable instructions for storage on a non-transitory computer-readable medium that, when executed by a processor, cause an apparatus to:
-
store a read lock request queue, wherein the read lock request queue records an identifier of a client that is in a client cluster and that is either in a read lock waiting state or obtaining a read lock for a shared resource, and wherein the read lock request queue further records a write lock allocation identifier indicating whether a write lock for the shared resource is allocated; store a read lock allocation count indicating a quantity of read locks allocated for the shared resource; receive, from a first client in the client cluster, a first read lock request carrying an identifier of the first client and carrying a first memory address in the read lock request queue; write the identifier of the first client into the first memory address; increase the read lock allocation count according to a quantity of read locks allocated to the first client when the write lock allocation identifier indicates that the write lock is not allocated; and send, to the first client, a first message carrying the write lock allocation identifier. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20)
-
Specification