LightMySky
En anglais

Consensus and Why Agreement Is Hard

Several machines have to agree on one value even though some may fail and messages may be delayed. A majority quorum plus a leader gets there in practice, and the theory says no deterministic protocol can guarantee both safety and progress when delays have no bound and a node may crash.

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

Ce que l'enfant saura faire ensuite

  • Explain why a majority quorum makes two conflicting decisions impossible
  • Follow a leader election and say what happens if the old leader returns
  • State what the impossibility result rules out and what it leaves available

1 · Lis

You already know copies can disagree and silence hides crashes. Consensus asks several machines to agree on one value even though some may fail and messages may be late. A majority means more than half. Two groups of a and b nodes drawn from n nodes share at least a + b - n of them. Two majorities of 5 nodes are groups of 3, and 3 + 3 - 5 = 1, so they always share a node.

5 nodes: 1 2 3 4 5majority X: 1 2 3majority Y: 3 4 53 + 3 - 5 = 1 shared
Try it together

Five nodes must pick one leader. Three vote for Ana and two for Ben, so Ana wins a majority. No rival group of three can vote for Ben without including someone who already voted for Ana, and nobody votes twice. Two conflicting decisions are impossible.

In practice a leader coordinates: it is elected, gathers votes, and announces the decision. Each election starts a new, higher term number. If the old leader returns after a failure, it sees the higher term, so the newer term wins and the old leader steps down instead of ruling beside it.

Theory adds one limit. When message delays have no bound and even one node may crash, no deterministic protocol can guarantee both safety and progress. That rules out a perfect protocol. It leaves practical ones that always stay safe and usually finish.

Majorities overlap so conflicts are impossible, a leader coordinates, and unbounded delay rules out perfection but not practice.

Original instructional content authored for os-taxonomy.

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