CSE Roadmap

Specialist tier · about 2 hours · 5 parts

Part 4 of 5 · 2 min read

The coordinator's single point of failure

If the coordinator crashes after some nodes have prepared but before telling them to commit or abort, those nodes are stuck waiting.

The coordinator's single point of failure

Think of the wedding planner from the previous part suddenly becoming unreachable. This happens right after every vendor confirmed, but before telling any of them whether to actually proceed. Every vendor is left stuck holding their confirmed commitment, with no instruction on what to do next.

In plain words: once a node has responded yes in the prepare phase, it must hold its prepared state, unable to unilaterally commit or abort on its own, until it hears the coordinator's final decision. If the coordinator crashes after receiving all the yes responses but before sending out the commit or abort decision, every prepared node is stuck in this uncertain, blocked state until the coordinator recovers and tells them what to do. This makes the coordinator a genuine single point of failure for the whole transaction, since no other node can safely decide the outcome on its own without risking disagreeing with whatever decision the coordinator may have already made before crashing.

A worked example. Node A and node B both respond yes during prepare. The coordinator crashes before sending the commit decision to either. Both A and B must now wait, holding their prepared changes without committing or aborting, until the coordinator restarts and tells them the actual decision.

The key lines. No new SQL; a production two-phase commit implementation typically persists the coordinator's decision to stable storage specifically so it can recover and resume this exact scenario after a crash.

Blocking (in two-phase commit)

Blocking, in two-phase commit, is the state a prepared node is stuck in after responding yes but before receiving the coordinator's final commit-or-abort decision, unable to safely proceed on its own.

Example: every vendor stuck holding their confirmation, unable to safely proceed without the wedding planner's final word, mirrors blocking in two-phase commit.

Remember this

Two-phase commit guarantees all-or-nothing across nodes, but it buys that guarantee at the cost of a coordinator whose crash can leave every other node stuck waiting, unable to decide the outcome safely on its own.

Quick notes

  • A distributed transaction spans more than one node and needs all of them to reach the same commit-or-abort decision.
  • Two-phase commit's prepare phase checks every node can commit; the commit phase tells every node to actually do so.
  • A node that has responded yes in prepare cannot unilaterally commit or abort; it must wait for the coordinator's decision.
  • A coordinator crash between receiving all yes responses and sending the final decision leaves every prepared node blocked.
  • Two-phase commit trades a strong all-or-nothing guarantee for the coordinator becoming a single point of failure.