






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







-^
2
1
1
-^
must latch all of T
’s updated pages before logging a 1
1
else, some w
[z] on P could be logged after a 3
1
but be
executed before a
, leaving a 1
’s LSN on P instead of 1
w
[z]’s. 3
Docsity.com
Log the undo(U) operation, and use its LSN on P^ –
CLR = Compensation Log Record = a logged undo
Do this for all undo’s (during normal abort or recovery)
-^
This preserves the invariant that the LSN on each page Pexactly describes P’s state relative to the log.^ –
P contains all updates to P up to and including the LSNon P, and no updates with larger LSN.
-^
So every aborted transaction’s log is a palindromeof update records and undo records.
-^
Restart processes Commit and Abort the same way^ –
It redoes the transaction’s log records.
It only aborts active transactions after the forward scan
Starting with the last checkpoint, scan forward in the log.^ –
Maintain list of active transactions (initialized to contentof checkpoint record).
Redo an update record U for page P only ifLSN(P) < LSN(U).
After you’re done scanning, abort all active transactions.Log undos while aborting. Log an abort record whenyou’re done aborting.
-^
-^
-^
Requires accessing only the log, not the database
-^
Flush(P) says to delete P from Dirty Page Table
Write(P) adds P to Dirty Page Table, if it isn’t there
Include Dirty Page Table in checkpoint records
Start at checkpt record, scan forward building the table
-^
-^
log records deleted from the first page (for undo)
log records inserted to the second page (for redo)
they’re the same records, so long them once!
-^
log the inserted data when the record is first inserted
if a page has N records, log N/2 records, every time apage is split, which occurs once for every N/2 insertions
-^
-^
-^
-^
-^
-^