Information Technology Reference
In-Depth Information
In practice, the beginning of a new transaction is recorded in the log, and the
transaction record is inserted into the active-transaction table when the transaction
performs its first read or update action on the database. Accordingly, if a transaction
never reads or writes a database, then neither its beginning or commit is recorded in
the log or in the active-transaction table.
For the purposes of the redo pass of restart recovery, a main-memory struc-
ture called modified-page table (or dirty-page table ), or page table for short, is
maintained. This table complements the main-memory structures maintained by the
buffer manager that contains information on which pages currently reside in the
buffer, which processes have them fixed and latched, and which pages have been
updated (recall the modified bit in the buffer control block of a buffered page).
For each modified page p in the buffer, the following information is stored in the
modified-page table:
1. The page identifier of page p
2. The recovery- LSN value for page p, denoted R EC -LSN .p/, which gives the earliest
position of the log from which there may be updates on page p that are not yet
reflected in the disk version of the page
The table is implemented using an efficient main-memory structure, usually a hash
table on the page-ids.
Whenever an unmodified page p in the buffer is turned to a modified page due to
the first update that makes the page differ from its disk version, the entry .page-id D
p; R EC -LSN D n/ is inserted into the modified-page table, where n is the LSN of the
log record of that update. We denote n by M ODIFIED -LSN .p/.Whenp is flushed onto
disk, its entry is deleted from the modified-page table.
When no failures occur, the equality
R EC -LSN .p/ D M ODIFIED -LSN .p/
is maintained. In general, in the presence of failures, we have
R EC -LSN .p/ M ODIFIED -LSN .p/:
(3.1)
The R EC -LSN s provide an easily maintained lower bound on the LSN soflog
records that need to be applied in order to reconstruct the state of the database after
a system crash or a process failure. When the current version of page p has been
lost or corrupted due to a failure, the redo pass of recovery (Sect. 4.8 )restoresthe
page from its disk version. This is done by scanning the log disk and redoing on the
page every update on it logged with a LSN greater than or equal to R EC -LSN .p/ if
the update is not yet in the page, that is, the P AGE -LSN of the page being restored is
less than the LSN of the log record being scanned.
Search WWH ::




Custom Search