LightMySky
به انگلیسی

Distributed Transactions and the Blocking Case of Two-Phase Commit

A transaction spanning several stores needs one atomic decision. Two-phase commit gets it by making participants promise before the coordinator decides, and its known weakness is that a coordinator failure at the wrong moment leaves participants holding locks with nobody to ask.

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

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

  • Walk both phases and say what a participant has promised once it votes yes
  • Identify the window where a coordinator failure blocks the participants
  • Say how running consensus on the commit decision removes the blocking case, and what it costs

۱ · بخوان

Linearizability makes copies of one object act as one. A transaction over several stores asks for something different: one outcome, commit everywhere or abort everywhere. Phase one: the coordinator asks every participant to prepare, and each votes yes or no. A yes vote is a promise: I will obey your decision, and I hold my locks until you tell me. A lock keeps other transactions off the data until released.

Try it together

One order lives in two stores. The coordinator asks both. Both vote yes, so the coordinator sends commit and both commit. Had one voted no, the coordinator would send abort and both would drop the change. The decision is one; the stores just obey it.

The blocking window opens once a participant votes yes: it can no longer decide alone, because another store may already hold a commit order from the coordinator. If the coordinator crashes in that window, yes-voters wait with locks held and nobody can answer them. A crash before anyone voted yes is harmless, since every store can abort.

Consensus lets machines agree on one value by majority. Running it on the decision removes the single decider: the replicas agree among themselves on commit or abort, so the survivors can finish as long as a majority is still up. The price is extra rounds of messages on every commit, not just when something breaks.

Yes means obey and wait; a dead coordinator in that window leaves voters blocked.

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

۲ · ببین

به انگلیسی

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

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

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

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

پیوندهای اختیاری

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

سپس تمرین

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

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