Volcano Recovery Journal
The lava-control computer keeps losing valve changes during power crashes. Build a journal that remembers every safe update before the machine acts.
π§ Before we start
At the circus, you kept event phases in a safe order. A crash-safe program also depends on order: write-ahead logging saves a change in a durable journal before changing the real data. After a crash, the journal tells the program what to recover.
Arrange the crash-safe program
Tap the four visual instruction cards in the only order that can survive a sudden power cut.
Log two valve updates
Send each update through the journal. Watch the durable entry appear before its matching valve changes.
π DURABLE RECOVERY JOURNAL
βοΈ REAL VALVE DATA
Recover after the power crash
North was completed. East was safely journaled, then power failed before its valve changed. Replay only the unfinished saved entry.
Debug the dangerous update order
This controller changes the valve first, then tries to save the journal. A crash between those steps leaves no recovery clue. Choose the safe repair.
π What you learned
- A write-ahead log is a durable journal of planned data changes.
- The journal must be saved before the program changes real data.
- A done marker says an update completed successfully.
- After a crash, recovery scans the journal instead of guessing.
- Recovery skips finished entries and replays saved unfinished entries.
- Safe ordering turns a sudden crash into a repairable interruption.