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?
- A. Because undo is always fully skipped in ARIES
- 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
- C. Because the order makes no actual difference to correctness
- 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
- A Compensation Log Record (CLR) in ARIES, written while undoing a transaction's update, includes a field pointing to the next log record…
- Write-ahead logging (WAL) requires that:
- A fuzzy checkpoint in ARIES records the set of active (dirty) transactions and dirty pages at checkpoint time WITHOUT forcing all dirty…
- Strict two-phase locking (Strict 2PL) differs from basic 2PL in which way?
- Rigorous two-phase locking (Rigorous 2PL) goes one step further than Strict 2PL. What extra guarantee does it add?
- Multiple Granularity Locking uses intention locks (IS, IX, SIX) on coarser objects like a table, in addition to ordinary shared/exclusive…