Information Technology Reference
In-Depth Information
When a checkpoint is to be taken, the call relocate-and-flush-pages .M / is first
executed one or more times, maybe with a slightly modified selection logic applied
for the pages to be flushed, one that ensures that the R EDO -LSN , that is, the minimum
of the R EC -LSN s of the modified pages, is advanced. This is then followed by writing
to the log the checkpoint log records, with copies of the modified-page and active-
transaction tables.
The redo pass of ARIES must not do any page relocations, besides redoing logged
page-id changes that are missing from parent pages. The redo pass is supposed to
just repeat previously done logged updates, not to generate any new log records. If
some modified pages must be evicted during the redo pass, which is unlikely, then
those pages go to the locations defined by the page-ids current at the time of the
redone updates.
In the redo pass, a page-id change on page p logged with a log record of the form
n Wh page-id-change ;p;x;q;q 0 i is processed exactly as expected: if R EC -LSN .p/
n,pagep is fixed and write-latched, and its P AGE -LSN is examined; if less than n,
the index record .x; q/ in page p is replaced by .x; q 0 /, P AGE -LSN .p/ is advanced to
n,pagep is unlatched, and so on.
Missing parent information for a modified B-tree page q can be added using
the call find-parent .q/ (Algorithm 15.4 ), which latches page q, takes some key
x from the page, unlatches q, and performs a traversal from the root page
along the search path for x, correcting parent links on all modified pages
encountered until q is entered. However, we are never actually forced to use
this call, because we always have the option of not relocating the modified
page.
To make it possible to redo the parent-link additions performed by the call find-
parent .q/, the additions could be logged with redo-only log records of the form:
h add-parent-link ;p 0 ;p i :
(15.2)
In the redo pass, such a log record is processed as expected: if R EC -LSN .p 0 / is less
than or equal to the LSN n of the log record, page p 0 is fixed and write-latched, and its
P AGE -LSN is examined; if less than n, the parent-link of p 0 is set to p, P AGE -LSN .p 0 /
is advanced to n,pagep 0 is unlatched, and so on.
Search WWH ::




Custom Search