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.
Answer checked How we write and check questions
Discussion