Skip to main content

Cascading aborts; atomic commit protocol

Short answer

Cascading aborts happen when a transaction reads uncommitted data and the writer later aborts, causing a chain of aborts. Strict 2PL or strict timestamp ordering (only committed reads) prevents it. Atomic commit protocols coordinate distributed transactions: a coordinator collects votes;if all vote yes, commit, else abort, ensuring atomicity and durability across servers, with recovery support.

How does cascading aborts occur and can be solved? Explain the needs and roles of atomic commit protocol in distributed system.

Cascading aborts

A cascading abort happens when a transaction reads a value written by another transaction that has not yet committed (a dirty read), and the writer then aborts. The reader has used data that never officially existed, so it must also abort, and every transaction that read the reader's data must abort too, forming a chain.

Example: T writes A = 50 (old value 30); U reads A = 50 and writes B based on it; T aborts, so A returns to 30. U's work is invalid and U must abort; any V that read B aborts too.

Solutions

  • Strict execution: delay reads and writes of an object until the transaction that last wrote it has committed or aborted. In practice this is strict two-phase locking (hold write locks until commit/abort).
  • Allow transactions to read only committed data (no dirty reads).
  • In timestamp ordering, make a reader wait for the tentative version to commit (strict timestamp ordering).

This also avoids the related problem of premature writes (restoring before-images wrongly) when aborts occur.

Need and roles of atomic commit protocol

An atomic commit protocol (ACP) is used to make sure that a distributed transaction, which has operations at several servers, is committed or aborted at all of them together.

Need: in a one-server transaction, commit is a local action. In a distributed transaction, if one server commits while another aborts (due to crash, lock conflict or validation failure), atomicity is violated and the data become inconsistent. A one-phase commit (the coordinator just tells everybody to commit) cannot handle a server that has to abort unilaterally.

Roles

  • Ensure atomicity: all participants reach the same decision (commit if all vote Yes, otherwise abort).
  • A coordinator collects votes and announces the decision; participants vote and carry it out.
  • Ensure durability: participants save tentative changes to permanent storage before voting Yes, so the decision can be completed after a crash.
  • Allow any participant to veto (abort) the transaction.
  • Provide recovery from crashes and lost messages using logs and timeouts.

The best-known ACPs are two-phase commit (2PC) and three-phase commit (3PC).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 8 questions →