LightMySky
به انگلیسی

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.

شروع یادگیری این موضوعبه حساب کاربری نیازی نیست. پیشرفت در همین مرورگر ذخیره می‌شود.

کارهایی که یادگیرنده بعد از این درس می‌تواند انجام دهد

  • 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

۱ · بخوان

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.

۲ · ببین

به انگلیسی

دور از صفحه‌نمایش

چاپ کاربرگکاغذ A4، با یک صفحهٔ جواب‌ها برای بزرگ‌ترها. بدون صفحه‌نمایش، بدون اینترنت.

جایگاه این موضوع

اول این‌ها را یاد بگیر

این موضوع راه این‌ها را باز می‌کند

سپس تمرین

۸ سؤال پشت این درس منتظرند، هر کدام با پاسخ توضیح‌داده‌شده. هر پاسخ آسمان را پر می‌کند: ستاره‌ها هنگام یادگیری روشن می‌شوند و وقتی زمان برگشتن است کمرنگ می‌شوند.

شروع یادگیری این موضوع