LightMySky
به انگلیسی

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.

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

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

  • 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

۱ · بخوان

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.

۲ · ببین

به انگلیسی

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

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

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

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

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

سپس تمرین

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

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