CSE Roadmap

Specialist tier · about 2 hours · 5 parts

Part 3 of 5 · 1 min read

The redo phase

Every logged change since the determined starting point is reapplied, regardless of whether its transaction ultimately committed.

Think of the inspector's crew now actually re-finishing every single change recorded since the relevant starting point. Workers do this for both finished and unfinished rooms alike, simply to bring the physical site back to exactly where the records say it should be.

In plain words: the redo phase reapplies every logged change from the starting point analysis determined, regardless of whether that specific entry's transaction ultimately committed or not. This might seem to contradict undo's purpose, but it is deliberate: redoing everything first brings the database to exactly the state it was in at the moment of the crash, including the effects of transactions that were still in progress, before the undo phase then separately reverts only the ones that never committed. Redoing unconditionally, rather than only redoing committed transactions, keeps the algorithm simpler and avoids needing to determine commit status before this phase runs.

A worked example. Redo reapplies both transaction A's committed change and transaction B's uncommitted change, bringing the database to the exact state it held at the moment of the crash, before the next phase decides what to do about B specifically.

The key lines. No new SQL; redo in ARIES reapplies log entries exactly as covered on the write-ahead-log page, but unconditionally across every entry from the starting point, not filtered by commit status at this stage.

Redo phase (ARIES)

The redo phase in ARIES reapplies every logged change from the point analysis determined, regardless of whether its transaction ultimately committed, restoring the database to its exact state at the moment of the crash.

Example: re-finishing every recorded change since a starting point, from both finished and unfinished rooms alike, to match the site to the records exactly, mirrors ARIES's unconditional redo.