CS FundamentalsHardGATE CS (PYQ pattern)
Transactions T1..T5 have timestamps equal to their numbers (T1 is oldest). Seven independent lock conflicts occur, written (requester, current holder): (T2,T4), (T3,T1), (T4,T2), (T5,T1), (T1,T3), (T5,T3), (T4,T1). Under wait-die, an older requester waits and a younger requester aborts itself; under wound-wait, an older requester aborts the holder and a younger requester waits. How many aborts happen under wait-die and under wound-wait respectively?
- A. 2 and 5
- B. 5 and 2
- C. 5 and 5
- D. 6 and 1
Correct answer: B. 5 and 2
Wait-die: the requester aborts when it is younger than the holder: (T3,T1), (T4,T2), (T5,T1), (T5,T3), (T4,T1) = 5 aborts. Wound-wait: the holder is aborted when the requester is older: (T2,T4), (T1,T3) = 2 aborts.
More DBMS and SQL questions
- Log (LSN: record): 1: T1 update P1; 2: T2 update P2; 3: T1 update P3; 4: begincheckpoint, whose endcheckpoint records ATT = {T1, T2} and…
- Log (LSN: record): 1: T1 update P1; 2: T2 update P2; 3: T1 update P3; 4: begincheckpoint, whose endcheckpoint records ATT = {T1, T2} and…
- 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…