Information Technology Reference
In-Depth Information
Chapter 3
Logging and Buffering
For the purposes of transaction rollback and restart recovery, a transaction log
is maintained during normal transaction processing. The log is shared by all
transactions, and it keeps, in chronological order, a record of each update on the
database. The log record for an update action makes possible the redoing of the
update on the previous version of an updated page when that update has been
lost due to a failure. The log record for a forward-rolling update action also
makes possible the undoing of the update in a backward-rolling transaction or in
a transaction that must be aborted due to a failure. The log records are buffered in
main memory before they are taken onto disk, but, unlike database pages, the log
records are flushed onto the log disk whenever some transaction commits, so that
each committed transaction is guaranteed to have every one of its updates recorded
either on the disk version of the database or on the log disk.
In this chapter we show how the physiological logging protocol applied in the
ARIES family of algorithms works in the case of the read-write and key-range
transaction models. In fine-granular physiological logging, an update action on a
tuple by a transaction is logged with a log record that carries, besides the arguments
of the logical update action, also the identifier of the data page that received the
update, so that the update can always be efficiently redone directly on the page.
Undoing an update may also be possible directly on the page mentioned in the log
record, provided that the page still is the correct target for the undo action; if not,
the logical information in the log record is used to undo the update logically.
Besides logical update actions, also structure modifications need be logged.
Unlike the solutions usually presented in connection with the ARIES recovery
algorithm, we advocate the use of redo-only structure modifications, each of which
is logged with a single redo-only log record that mentions all the few pages (a small
constant number) involved in the modification. Such a log record is only used to
redo a structure modification, if necessary, but the modification is never undone.
The log can serve its purposes only if a protocol called write-ahead logging
( WA L ) is followed in database and log buffering. The WA L protocol states that an
Search WWH ::




Custom Search