CS FundamentalsVery hardProduct company interview · GATE level

ARIES recovery performs three phases on restart: analysis, redo, then undo. Why must redo happen BEFORE undo, rather than undoing first and then redoing only what remains necessary?

  1. A. Because undo is always fully skipped in ARIES
  2. B. Because redo must first bring the database to the exact state it was in at the moment of the crash (including effects of transactions that later need to be undone), so that undo then has a consistent, complete starting point to work backward from, using CLRs to guarantee idempotence even if the system crashes again mid-undo
  3. C. Because the order makes no actual difference to correctness
  4. D. Because analysis always fully completes both the redo and undo work itself

Correct answer: B. Because redo must first bring the database to the exact state it was in at the moment of the crash (including effects of transactions that later need to be undone), so that undo then has a consistent, complete starting point to work backward from, using CLRs to guarantee idempotence even if the system crashes again mid-undo

ARIES's 'repeat history' principle redoes EVERY logged update (including ones made by transactions that will be undone), restoring the exact pre-crash state first. Only then does undo roll back the effects of loser (uncommitted) transactions, writing Compensation Log Records (CLRs) so that even a second crash during undo can resume correctly without re-undoing already-undone work.

More DBMS and SQL questions

Exams that ask this topic