A candidate becomes leader only with a majority of votes.

highlighted = computed this step

A majority elects a leader

A candidate becomes leader only after it has a majority of votes in its term. The vote tally is recomputed from the timeout event. Note: the leader role appears after the win event.

majority election\text{majority election}

Vote tally

The majority threshold is 2 out of 3 nodes, and the tally has 3 votes. Note: the tally is shown in the render.

majority=2,nodes=3,votes=3\text{majority}=2,\quad \text{nodes}=3,\quad \text{votes}=3

a simplified Raft over a tiny cluster: terms, votes, leader election, and the term-restricted commit rule are exact on these traces; the full safety proof, membership changes, snapshotting, log compaction, and real RPC/timing are beyond these traces - no product claims.

Majority elects - commitIndex 0; votes: t1 A:3node012At0/Ft1/Ct1/LBt0/Ft1/Ft1/FCt0/Ft1/Ft1/F leader log A - commitIndex 0

Leader installed

The compiled trace has 1 leader. Note: the leader is a result of replaying the win event.

leaders=1\text{leaders}=1

a simplified Raft over a tiny cluster: terms, votes, leader election, and the term-restricted commit rule are exact on these traces; the full safety proof, membership changes, snapshotting, log compaction, and real RPC/timing are beyond these traces - no product claims.

Majority elects - commitIndex 0; votes: t1 A:3node012At0/Ft1/Ct1/LBt0/Ft1/Ft1/FCt0/Ft1/Ft1/F leader log A - commitIndex 0

Summary

A majority is what turns a candidate into a leader for a term. Note: this is simplified Raft; the full safety proof, membership changes, snapshots, and real timing are beyond these traces.

majority installs leader\text{majority installs leader}