CS FundamentalsModerateGATE CS (PYQ pattern)
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>, <T2,B,20>, <T1,C,30>, <T1 commit>, <T3 start>, <T3,A,15>, <T2,C,35>. Disk contents at the crash (all updates had reached disk): A = 40, B = 21, C = 50. Recovery scans the log backwards and restores old values for uncommitted transactions. What are (A, B, C) afterwards?
- A. (15, 20, 30)
- B. (15, 20, 35)
- C. (10, 20, 35)
- D. (40, 21, 50)
Correct answer: B. (15, 20, 35)
T1 committed (its new values stay: A = 15, C = 35). T2 and T3 did not commit, so their old values are restored in reverse order: B returns to 20, C's T2 write (old 35) restores C = 35, and T3's write restores A to its old value 15.
More DBMS and SQL questions
- 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…
- Multiversion timestamp ordering with TS(T1) < TS(T2) < TS(T3): a read of X returns the version with the largest write timestamp <= TS(T)…