Information Technology Reference
In-Depth Information
As in a page-server system, every transaction in a shared-disks system runs from
start to end at one node. Such a transaction can naturally be a subtransaction of
some distributed transaction in a distributed database system having the shared-
disks system as one of its sites.
Every node maintains its own log, to which the log records written for the node's
transactions are first appended. Every node determines the LSN s of log records in
the same way as the clients in a page-server system. One of the nodes has access to
the log files of all the other nodes, and a log-merge process merges the log files into
a single file.
The buffering (or caching) of pages in the buffers of the nodes is controlled by
the same privileges as in a page-server system: a page can reside for reading in the
buffers of many nodes at the same time, but buffering a page for updating at one
nodes is possible only if the page is not buffered at any other node.
The write privilege held by node s 1 on page p can be transferred to another node
s 2 in several ways. In the simplest (and also the slowest) way, page p is transferred
by the disk: node s 1 flushes p from its buffer onto the disk, applying the WA L
protocol, purges p from its buffer, and gives up its caching privilege on p,after
which node s 2 gets its write privilege on p and fetches p from the disk to its buffer.
In a slightly faster way, node s 1 flushes p onto disk and at the same time ships p to
node s 2 via a communication link, thus saving a disk access at s 2 .
In the fastest ways, node s 1 , the current holder of the write privilege on page p,
does not flush p onto disk but only takes the log records up to P AGE -LSN .p/ to the
log disk and then ships p to node s 2 via a communication link. In this way a page
can hold updates performed at more than one node until it is flushed onto disk. This
adds complication to failure recovery. When the node that last updated p crashes,
the current version of p is lost; in redoing the lost updates on the disk version of p
the merged log must be scanned from a certain R EC -A DDR .
In the very fastest way of transferring, node s 1 does not even take the log records
onto disk before shipping page p to node s 2 . To make this possible, the WA L protocol
must be changed so that a modified page can be flushed onto disk only after all the
nodes that have updated the page have taken their logs onto the log disk.
Problems
14.1 Consider a transaction generated by the following application-program frag-
ment running at client c:
exec sql select sum (V ) into : v from r ;
exec sql update r set V D : v where X D 0;
exec sql commit .
There exists a sparse (primary) B-tree index to r.X;V / on attribute X (unique
key).
Search WWH ::




Custom Search