2) 1 State XX XXX System Before XXXXX XXX XXXXX XX the system right before XXX XXXXX XX as follows: XXXXXXXXXXX Table: XXXXXXX XXXXXXX status T1 X XXXXXXX (i.e. XX Progress) XXXXXXXXXXX T1 XXXX removed XXXX the table after we force-write (i.e., write XXX XXX XX disk) XXX commit log record. XXXXX before being removed, XX XXX an entry in XXX table with l XXXXXX committed. XXXXX Page Table: XXXXXX XXXXXX P1 1 XX X Log: LSN XXXXXXX XXXXXXX type pageID XXX entry undoNextLSN 1 T1 - Update XX - X XX - Update P2 - 3 T3 X XXXXXX P7 - X T1 X XXXXXX XX - 5 T1 4 Commit - - X T2 3 Abort P1 - X T1 X XXX - - - 3) Redo Phase XXX REDO XXXXX XXXXXX XX the XXXXXX, which XX the smallest XXX in the XXXXX XXXX XXXXX. In XXXX XXXXXXX, it's XXX 1. For each XXXXXXXX XXX record (update or XXX), the XXXX phase XXXXXX the change XX XXXXXXXXX. To XXXXX if the XXXXXX needs to XXXXXXX the XXXXXX XX the XXXX, it rst checks XX XXX XXXX is in XXX XXXXX XXXX XXXXX. XX it is in XXX table, XXXX it XXXXXX XXXX the XXXXXX for the page is lower or XXXXX to the XXX XX the change under XXXXXXXXXXXXX. If XXXX XX XXX case, XXXX nally XXX system reads the page XXXX disk XXX checks XX XXX pageLSN is XXXXXXXX XXXXXXX than XXX XXXXXXX LSN. If XXXX is XXX case then it redoes XXX change. XXXXXXXXX, it skips the change. In XXX XXXXXXX, XX XXX XXX XXXXXXXXX: XXX 1: XXXXXX. LSN 2: XXXXXX LSN 3: No need to redo XXXXXXX Page LSN XX 3 XXXXXXX. XXX 4: Redone XXX 5: Skipped XX XXXX XXXXX, XXX system is XXXX in XXX state XX the time XXXX XXX XXXX of the log was XXXX ushed XX disk. The system XXX now write an XXX XXXX XXXXXX XXX T1. XXXX XXXXXX will have XXX 6. XX can then be XXXXXXX from the Transaction XXXXX. 4) The system XXXX XXXX XX. XX's XXX only transaction in XXX Transaction Table. XXX XXXXXXX is X. So we start undo at XXXX LSN 3. There XX no XXXX XX write an abort log record during undo. XXX system XXX write XXXX XXXXXXXX: 5 Second XXXXX Let's XXXXXXXX XXXXXXX XXXXXXXXX XXX a second crash: System XXXXXXX without XXXXXX XXXXXXX XXX of XXX XXX XXX entries or pages to XXXX: XX that case, the system XXXX redo the analysis, redo, XXX undo phases in XXXXXXX the XXXX XXX as we did XXXXX. System XXXXX XXX log to XXXX, except XXX XX's END log record: XX that XXXX, XX XXX end XX XXX analysis phase, only XX is in XXX Transaction XXXXX. XX have XXX XXXX Dirty XXXX Table. The XXXX XXXXX XX the XXXX XX above XXXXX XXX X. For LSN X, the system XXXX nothing. XXX LSN X, if we previously ushed XXX page to disk, XXXX XX XXXX it. Otherwise, XX reapply the change. Same for LSN 8. XXXXXXX, XXX XXXX XXXXX XXXX XXXX T2. XX XXX a CLR XXX XX XXXXXXX XXX XXXXXXXXXXX. So it XXXXXX an END log XXXXXX directly. XXXXXX ushed XXX entire XXX log to XXXX: XX that XXXX, the transactions table at XXX XXX of XXX analysis XXXXX XX empty and XXX system would XXX XXXX XXXXXXXX. XXXXXX XXXXXXX XXXXX XXXXXX CLR with LSN X. XX XXXX XXXX, XXX XXXX phase XXXXXX XXXX that CLR XXXX undoing XX. XX XXXXXXXX follows XXX undo NextLSN XXXXXXX. It adds the second CLR and XXX log records.