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)?
- A. 5
- B. 6
- C. 7
- 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
- A system uses UNDO-only logging; log records <T,item,old value> hold the value BEFORE the update. Log: <T1 start>, <T1,A,10>, <T2 start>…
- T1: R1(X), W1(Y), C1 and T2: W2(X), R2(Y), C2. Of all interleavings, let s be the number that are strict schedules (no read or write of an…
- A wait-for graph over T1..T5 has edges T1→T2, T2→T3, T3→T1, T2→T4, T4→T1, T3→T5, T5→T2, T4→T5. How many distinct simple directed cycles…
- Under snapshot isolation item X has committed versions (commit timestamp: value): 0: 10, 5: 20, 9: 30, 14: 40. A transaction reads the…
- T1: R1(X), W1(Y); T2: W2(X), W2(Y); T3: W3(X), W3(Y), R3(Y). Of all 210 interleavings, how many are view-serializable and how many are…
- TS(T1) < TS(T2) < TS(T3). T1: W1(A), R1(B); T2: R2(A), W2(B); T3: W3(A), W3(B). Of all 90 interleavings, how many complete with NO abort…