CS FundamentalsHardGATE 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. The undo pass then rolls back all loser transactions. How many new CLRs are written (one per undone update; updates already compensated by an earlier CLR are skipped)?

  1. A. 5
  2. B. 6
  3. C. 7
  4. D. 4

Correct answer: A. 5

Losers are T1, T3, T4 (T2 committed). Their updates not yet compensated are LSNs [1, 5, 7, 9, 10] (LSN 3 was already compensated by the CLR at LSN 8), so 5 CLRs are written.

More DBMS and SQL questions

Exams that ask this topic