Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the transactions or during recovery.
Which of the following statements is/are correct?
View worked solution
Answer: A
The correct option is A.
Explanation:
Log-based recovery protocols (such as those using Write-Ahead Logging) are designed to be idempotent. This means executing the recovery process (redo and undo operations) multiple times has the same effect as executing it exactly once.
- Why the same lists are used (Option A): When a database crashes during recovery, the log stored on the non-volatile disk remains unchanged. Upon restarting, the recovery manager scans the log from the beginning. Since the log contents have not changed, the analysis phase will identify the exact same set of committed transactions (to be redone) and active/uncommitted transactions (to be undone). Therefore, the same undo and redo lists will be reconstructed and used.
- Why Option B is incorrect: The system can successfully recover because the redo and undo operations are idempotent. Repeating them after a second crash will still bring the database to a consistent state.
- Why Option C is incorrect: Any actions that were partially or fully undone/redone before the second crash will be processed again during the new recovery cycle to ensure correctness.
- Why Option D is incorrect: The database will not become inconsistent because the recovery process ensures atomicity and durability, even in the event of multiple crashes during recovery.
Free practice · Your answers on this page are not saved.
