CS FundamentalsVery hardGATE CS (PYQ pattern)

Log (LSN: record): 1: T1 update P1; 2: T2 update P2; 3: T1 update P3; 4: begin_checkpoint, whose end_checkpoint records ATT = {T1, T2} and DPT = {P1 (recLSN 1), P3 (recLSN 3)}; 5: T3 update P1; 6: T2 commit; 7: T4 update P4; 8: CLR for T1's update at LSN 3; 9: T3 update P5; 10: T4 update P4. The system crashes after LSN 10. Page LSNs on disk: P1 = 0, P2 = 2, P3 = 0, P4 = 0, P5 = 0. After ARIES analysis, what LSN does the redo pass start from, and how many log records does it actually re-apply (redo applies an update or CLR only if its page is in the DPT, LSN >= the page's recLSN, and the on-disk page LSN is smaller)?

  1. A. start at LSN 1; 9 records re-applied
  2. B. start at LSN 5; 7 records re-applied
  3. C. start at LSN 1; 5 records re-applied
  4. D. start at LSN 1; 7 records re-applied

Correct answer: D. start at LSN 1; 7 records re-applied

Analysis adds P4 (recLSN 7) and P5 (recLSN 9) to the DPT; the minimum recLSN is 1. P2 is not in the DPT, so LSN 2 is skipped. Re-applied: LSNs [1, 3, 5, 7, 8, 9, 10].

More DBMS and SQL questions

Exams that ask this topic