Click a server to take it offline (click again to restart it). Shift-click a server to force its election timeout. Watch elections, heartbeats and log replication keep the replicated state machines consistent.
The number inside a blue AppendEntries dot is how many log entries that message carries,
at most 5 per message. A small dot with no number carries no entries: it is a heartbeat, which tells
followers the leader is alive and passes on the leader's commit index. Every AppendEntries also carries
prevIndex/prevTerm, the index and term of the entry just before the new ones.
The follower accepts the message only if its own log has an entry there with that same term.
How a server is brought up to speed after being offline:
nextIndex for each follower: its guess for the next entry to send (the leader row shows next/match).
It sends AppendEntries starting from there.prevIndex entry, or holds it with a different term, it
rejects the message (red hollow reply). The leader lowers nextIndex by one and retries right away.
This repeats until the leader reaches the last entry both logs agree on.matchIndex. The leaderCommit field lets the follower advance its own
commit index and replay the committed entries into its state machine, rebuilding the key/value store.Try it: take a server offline, send a burst of client requests, then bring it back. You will see a few rejections, then numbered dots streaming the missing entries.
next/match indices for each follower.