Practice mode DBMS and SQL

At a crash, T1 had committed but some of its updated pages were still only in memory, and T2 was still active with some of its updates already on disk. What does log-based recovery do?

Correct answer C. Redo T1 and undo T2

Explanation

A committed transaction must be durable, so its logged changes are redone to restore any updates lost from memory. An uncommitted transaction must be atomic, so any of its changes that reached disk are undone using the before-images in the log. That is why recovery has a redo pass for winners and an undo pass for losers. Reversing the roles would break both durability and atomicity.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.