LightMySky
En anglais

Raft: Leader Election and Log Replication

One consensus algorithm end to end. A term-numbered election picks a single leader, the leader appends entries to its followers, and an entry is committed once a majority holds it. Every rule in the protocol exists to stop one specific bad history.

Commence ce sujetPas besoin de compte. La progression est enregistrée dans ce navigateur.

Ce que l'enfant saura faire ensuite

  • Walk an election through a term change and say why two leaders cannot both win one term
  • Say what commitment means here and why a majority is the threshold
  • Take one rule of the protocol and name the history it prevents

1 · Lis

Raft numbers every election with a term. A majority is more than half the nodes. Each node votes once per term, so two candidates cannot both win one term: two majorities share a voter, and that voter only votes once. The winner becomes the single leader. If votes split and nobody wins, nodes wait a random time and start the next term, so Raft gives up a guaranteed finish.

Try it together

The leader takes client writes, appends them to its log, and sends each entry to its followers. An entry the leader added in its own term is committed once a majority holds it. If the leader fails, the new leader is elected and every committed entry survives, because any majority includes a copy.

Every rule blocks one specific bad history. Voting once per term blocks two leaders deciding differently. Requiring an up-to-date log for new leaders blocks the loss of committed entries.

Good to know

Walk any failure by asking one question: did the leader that added the entry get it onto a majority during its own term? If yes, the entry is committed and survives. If no, it may be gone.

One leader per term appends entries, majorities commit them, and committed means surviving.

Lesson, quiz and flashcard text written for this dataset and revised in the P25 source pass.

2 · Regarde

En anglais

Sans écran

Imprimer une fiche d'exercicesFormat A4, avec une page de corrigés pour les adultes. Sans écran, sans internet.

Où se situe ce sujet

Puis s'entraîner

8 questions attendent derrière cette leçon, chacune avec sa réponse expliquée. Chaque réponse nourrit le ciel : les étoiles s'allument à mesure qu'elles sont apprises, et pâlissent quand vient le moment de revenir.

Commence ce sujet