Information Technology Reference
In-Depth Information
The insertion of the tuple . z ; w 0 / into page p 2 has been undone by deleting
the tuple from its then current location in page p 3 . (If p 3 6D p 2 , there must be
between the log records with LSN s n 3 and n 5 a log record for a structure modification
triggered by some other transaction that has moved the tuple from page p 2 to page
p 3 .) The deletion of . z ; w / from page p 1 has been undone by inserting . z ; w / into
page p 4 .
Observe that the U NDO -N EXT -LSN chain from the log record with LSN n 5 skips
over the log records with LSN s n 4 and n 3 back to the log record with LSN n 2 ,which
is the log record for the action to be undone next (Fig. 3.1 b). Similarly, the U NDO -
N EXT -LSN chain from the log record with LSN n 6 skips over the log records with LSN s
n 5 , n 4 , n 3 ,andn 2 back to the log record with LSN n 1 , which is the begin-transaction
log record for T 2 , thus indicating that the rollback is complete (Fig. 3.1 c).
Also observe that the U NDO -N EXT -LSN value in the log record for an undo action
is always the same as the U NDO -N EXT -LSN value in the log record for the action to
be undone.
t
Thus far we have assumed that the logical database consists of only one relation.
If the logical database has more than one relation, an identifier for the relation r
must be included in the log records. The log records for the forward-rolling update
actions are now:
h T; W; p; r.x; u ; v /; n 0 i .
h T; I; p; r.x; v /; n 0 i .
h T; D; p; r.x; v /; n 0 i .
The log records for the undo actions are:
h T; W 1 ;p;r.x; u /; n 0 i .
h T; I 1 ;p;r.x/;n 0 i .
h T; D 1 ;p;r.x; v /; n 0 i .
Naturally, in the most general case when the logical database is divided into
several databases, the log records must also carry the identifier of the database on
whose relation the update action is performed.
3.5
Logging Structure Modifications
As explained in Sect. 2.8 , a structure modification on the physical database is an
atomic unit of its own that “commits” independently of the outcome (commit or
abort) of the transaction that caused the structure modification. To make possible the
redoing of structure modifications that in the event of a process failure or a system
crash are not reflected in the disk version of the database, all structure modifications
must be logged.
Search WWH ::




Custom Search