In this lesson · topic 3 of 7
Topic 3
Crash the leader and cut the cluster
8 min read
The cluster
Each card is a node: its role, its term, who it voted for, and its log as a row of cells. A solid cell is committed, a dashed one is in the log but not yet committed, and the colour of a cell’s edge is the term it was written in. The event list says what just happened in plain words. Writes arrive on their own every half second, and the button sends one more.
Predict before you press play
Things to try
- Press Crash on the leader. Watch the term go up and a new leader appear. Restart the old node and watch it take the new leader’s log.
- Press Cut the leader into a minority. Submit a few writes. The cut-off leader’s new cells stay dashed. The other side elects a new leader and its cells turn solid.
- Press Heal the network. The old leader steps down, its dashed cells are deleted, and every log ends up identical.
- Set the election timeout to 150 ms and the network delay to 100 ms. Crash the leader a few times and watch the split vote counter.
- Crash three of five nodes. There is no leader and nothing commits, however long you wait. Restart one and the cluster recovers.
The full-page lab has five guided experiments with one-click setups.