Information Technology Reference
In-Depth Information
table are tuples .c;x;m;d/,wherec is the identifier of the client whose transaction
T holds the lock .T;x;m;d/ recorded in the local lock table at c.Ifm is a shared
mode, so that several transactions can hold an m lock on x, the lock is recorded in
the global lock table at most once per client.
A client can grant a shared lock to any of its transactions when some of its
transactions currently holds the lock, while an exclusive lock can only be granted
by communicating with the server.
Example 14.6 Transaction T at client c starts and requests a commit-duration
Slockonkeyx, in order to perform a read action RŒx. Client c examines its local
lock table to see if some other transaction at c holds a lock on x that is incompatible
with mode S .Ifso,T must wait. Otherwise, if some other transaction at c holds an
Slockonx, then client c can grant the requested lock to T without communicating
with the server. The lock .T; x; S; commit duration/ is recorded in the local lock
table of c.
If, on the other hand, no transaction currently holds a lock on x, client c requests
from the server an S lock on x in the name of c. The server examines the global
lock table to see if some other client holds an incompatible lock on x.Ifso,the
client request must wait. When there are no longer any incompatible locks on x,
the server grants the lock .c; x; S; commit-duration/ to client c and records it in the
global lock table. Client c records the lock .T; x; S; commit duration/ in its local
lock table, after which T can read x.
Next, transaction T requests an X lock on x in order to perform a write action
WŒx. Client c examines its local lock table to see if some other transaction at c
holds a lock on x.Ifso,T must wait. When there are no longer any local locks
on x, client c requests from the server an X lock on x in the name of c.Theserver
examines the global lock table to see if some other client holds a lock on x.Ifso,the
client request must wait. When there are no longer any lock on x, the server grants
the lock .c; x; X; commit duration/ to client c and records it in the global lock table.
Client c records the lock .T; x; X; commit duration/ in its local lock table. Now T
can write x.
t
14.10
Shared-Disks Systems
Many of the techniques needed in the management of a page-server system apply
as such or as somewhat modified to the management of a shared-disks system .
Differences are due to the characteristic that in a shared-disks system, there is no
distinguished server node, but all nodes in the system are peers : every node runs an
instance of exactly the same database management system.
Every node has a direct access to the shared database via its local buffer: the
node can fetch a page from the disk into its buffer and take an updated page from
the buffer back to its location on disk. A page can also be transferred from the
buffer of a node via an interconnection network to the buffer of another node. This
is usually faster than transferring the page via disk.
Search WWH ::




Custom Search