GATE / CS ARCHIVE

SUBJECT COLLECTION

Database Management Systems · Recovery & Logging

7 questions, newest first

GATE CSE has asked 7 questions on Recovery & Logging (Database Management Systems) from 2003 to 2025, in 7 of the 46 papers; the most recent is in GATE CSE 2025 Set 1. In the last five years it carried 0.1 marks per 100-mark paper on average, against 0.3 since 2003. Since 2014 the questions have been 4 MCQ and 1 MSQ. 2 groups of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
1 mark · MCQ
Report issue

Tracing a cascading transaction rollback

Recovery & Logging

Question 15, GATE 2025: A database schedule is R1(X), W1(Y), R2(X), R2(Y), R3(Y), followed by ABORT(T1). No intervening commit or write is shown. Which other transactions must roll back? A only T2; B only T3; C both T2 and T3; D neither.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (8 steps)

Approach: Track reads of a value produced by an uncommitted transaction; read-read overlap alone is not a rollback dependency.
W1(Y) installs T1’s new value of Y. R2(Y) occurs after that write and before T1 commits, so T2 reads an uncommitted value from T1. R3(Y) sees the same value because no intervening write to Y is shown; T3 also depends on T1.
When T1 aborts, its write to Y must be undone. Both dependent transactions have computed using a value that cannot be retained, so both must roll back. This is a cascading rollback and gives C.
The reads R1(X) and R2(X) do not establish a dirty-read dependency because neither transaction writes X in this schedule. The important issue is which transaction produced the value read, not simply whether two transactions access the same data item.

Original paper, page 15 · Answer key

1 mark · MSQ
Report issue

Recovery & Logging

Question 13, GATE 2021: A database crashes again while recovering from a previous crash. No checkpoints are taken during transactions or recovery. Select correct statements in the intended basic recovery model. A the same undo and redo lists are used on restarting recovery; B further recovery is impossible; C transactions already undone/redone will not be recovered again; D the database becomes inconsistent.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A

Our answer: A in the basic repeated undo/redo model

Without a new checkpoint or changed transaction-completion history, restarting recovery analyzes the same log to identify the same committed and uncommitted transactions. Undo/redo actions are designed to be idempotent, so a second crash does not make recovery impossible or inherently inconsistent. Thus A in the intended basic log-recovery model. An implementation with compensation log records may track already completed recovery work more precisely; the answer is not a universal claim that every recovery algorithm literally repeats an unchanged physical work list.

Redo reapplies logged updates for transactions whose effects must survive; undo removes effects of incomplete transactions. Idempotence means redo(redo(state))=redo(state), with corresponding safe repeated undo semantics. A crash can leave only a prefix of recovery finished, so a correct recovery design cannot assume that restarting itself destroys consistency. No new checkpoint is available to certify that the earlier log prefix can be ignored. More elaborate logging of recovery work is precisely the qualification already retained above.

Original paper, page 18 · Answer key

2 marks · MCQ
Report issue

Recovery & Logging

Question 51, GATE 2016: Schedule S=r2(X);r1(X);r2(Y);w1(X);r1(Y);w2(X);a1;a2, where r,w,a mean read,write,abort. A nonrecoverable; B recoverable but cascading abort; C no cascading abort; D strict.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (10 steps)

Every read occurs before the other transaction has written the read item, so neither transaction reads uncommitted data from the other. There is therefore no read-dependency requiring a cascading abort, C. The two explicit aborts do not themselves establish a cascade. The schedule is recoverable (neither commits prematurely), but not strict because w2(X) overwrites uncommitted w1(X).

Dirty reads, dirty writes and recoverability are different conditions. Here r2(X),r1(X) occur before w1(X), and neither transaction writes Y, so all reads see previously committed values. But w2(X) occurs before T1 aborts, a dirty write, ruling out strictness. Two transactions aborting in the same schedule need not have a causal read-dependency cascade.

Original paper, page 41 · Answer key

2 marks · MCQ
Report issue

Recovery & Logging

Question 39, GATE 2015: Simple checkpoint log: startT4; writeT4 y2→3; startT1; commitT4; writeT1 z5→7; checkpoint; startT2; writeT2 x1→9; commitT2; startT3; writeT3 z7→2; crash. Choose undo/redo lists: A undoT3, T1/redoT2; B same undo/redoT2, T4; C no undo/redo all four; D undoT3, T1, T4/redoT2.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

T4 committed before the completed checkpoint and needs no redo. T2 committed after it and must be redone. T1 and T3 are incomplete at crash and must be undone, including T1 begun before the checkpoint. Hence Undo{T3, T1}, Redo{T2}, A, under the stated simple checkpoint model.

Classify transactions by completion relative to the checkpoint and crash. T4 committed before the completed checkpoint, so the simple model treats its effects as safely checkpointed. T2 committed later and needs redo to ensure its updates appear. T1 and T3 have no commit record, so their changes must be undone, even though T1 started before the checkpoint. Starting before a checkpoint does not automatically make an unfinished transaction safe. More elaborate recovery protocols may scan different worklists, but this is the stated simple model.

Original paper, page 39 · Answer key

2 marks · MCQ
Report issue

Recovery & Logging

Question 51, GATE 2015: A partial schedule lists these operations in time order: 1 T1:read(A); 2 T1:write(A); 3 T2:read(C); 4 T2:write(C); 5 T2:read(B); 6 T2:write(B); 7 T2:read(A); 8 T2:commit; 9 T1:read(B). T1 fails immediately after time 9. Which statement is correct? (A) Abort T2, then restart both T1 and T2 to ensure atomicity. (B) The schedule is non-recoverable and cannot ensure transaction atomicity. (C) Abort and restart only T2 to ensure atomicity. (D) The schedule is recoverable and ensures atomicity without doing anything else.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (12 steps)

1. T2 reads A at time 7 after T1 writes it at time 2, before T1 commits.

2. T2 then commits at 8. When T1 fails after 9, its uncommitted value has already influenced a committed transaction. This violates recoverability: a reader must not commit before the transaction whose value it read. T2 cannot simply be treated as an uncommitted transaction to roll back. Thus B.

Original paper, page 73 · Answer key

1 mark · MCQ
Report issue

Undo and redo after a crash

Recovery & Logging

Question 20, GATE 2006: A bank account initially has balance 12000. A transaction transfers 2000 to mortgage M, then another applies 5% interest. Log records are:
1 T1 start
2 T1 B old=1200 new=10000
3 T1 M old=0 new=2000
4 T1 commit
5 T2 start
6 T2 B old=10000 new=10500
7 T2 commit
The old value 1200 in record 2 is printed despite the narrative's 12000. The system crashes just before record 7 is written. Which recovery assertion is true?
Options:
(A) Redo record 6, setting B=10500
(B) Undo record 6 to B=10000, then redo records 2 and 3
(C) Records 2 and 3 need not be redone because T1 committed
(D) Redo and undo can be performed in arbitrary order because they are idempotent
Tap to enlarge
Your answer
Answer & solution

Answer: B under undo-redo logging (no official key was published)

1. T1 has a commit record, whereas T2 does not. Undo T2’s balance change to 10000 and ensure T1’s balance/mortgage changes 10000 and 2000 are redone, B.

2. Commit does not necessarily force all modified pages to disk in undo-redo logging; idempotence does not allow arbitrary ordering of conflicting log actions. The printed old balance in record 2 is 1200 although the narrative says 12000.

3. That inconsistency does not change the committed new balance or this recovery conclusion, but it is not silently corrected.

4. Teaching check: Recovery distinguishes a transaction whose commit record reached the log from one whose commit record never did. Redo protects committed effects that may not yet be on disk; undo removes effects from incomplete transactions that may already have reached disk. A commit record is therefore not proof that every data page was forced.

Original paper, page 3

1 mark · MCQ
Report issue

Potentially unrecoverable dirty reads

Recovery & Logging

Question 29, GATE 2003: Which operation may lead to an irrecoverable database error? A. Writing an item after an uncommitted transaction reads it; B. Reading an item after an uncommitted transaction reads it; C. Reading an item written by a committed transaction; D. Reading an item written by an uncommitted transaction.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Use the concrete schedule W₁(X), R₂(X), C₂, A₁. Transaction 2 has already committed a result based on transaction 1’s value when transaction 1 aborts. Recovery would need to undo a committed dependency, which is why the schedule is nonrecoverable. The word “may” matters: a dirty read need not always lead to such a commit order.

2. If T 2 reads data written by uncommitted T 1, then T 2 commits before T 1 aborts, the schedule is nonrecoverable: a committed transaction depended on an aborted value. Thus D may lead to the stated error. A dirty read alone does not always force irrecoverability; delaying dependent commits can permit cascading rollback.

Original paper, page 4