Volcano Two-Phase Launch
Three safety stations must switch the lava shield together. Coordinate one all-or-nothing update so the island never ends with half the shield on and half off.
π§ Before we start
Pizza Saga Kitchen repaired a partly finished job by undoing completed steps. Today, two-phase commit prevents a partial result: first every participant prepares and votes, then one shared decision tells everyone to commit or abort.
Build the atomic protocol
Tap the stages in order. The coordinator must ask before deciding, and it must save one decision before broadcasting the result.
Commit when everyone is ready
Poll each station. When all three vote ready, choose the only safe global decision and send it to every station.
waiting
waiting
waiting
Abort on one rejection
The Coolant station cannot reserve enough water. Decide what every participant must doβeven the two stations that already prepared successfully.
YES Β· reserved
YES Β· reserved
NO Β· unavailable
Recover one remembered decision
The coordinator saved COMMIT, told Thermal, then crashed before reaching Gate and Coolant. Choose the recovery that keeps one transaction from splitting into different results.
restarting
COMMITTED
π What you learned
- Atomic transactions finish everywhere or nowhere.
- Phase one asks every participant to prepare and reserve what it needs.
- All YES votes allow COMMIT; any NO vote requires ABORT.
- The coordinator saves one durable global decision before broadcasting it.
- Prepared participants wait rather than guess if the decision message is missing.
- After a crash, replaying the saved decision brings every participant to the same result.
- That waiting is also a trade-off: classic two-phase commit can block until the decision is recovered.