Distributed Transaction Protocols
Distributed transaction protocols must coordinate a common commit decision and a valid execution order. Durable preparation solves a different problem from timestamped visibility.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 3
- Reading time
- 2 min
In this article3 chapters
A prepared participant has made a promise
In two-phase commit a coordinator asks each participant to prepare. A yes vote means it has durably recorded the resources and proposed writes needed to commit later. A commit decision requires every participant to have voted yes.
\[ \mathrm{Commit}\ \Longrightarrow\ \bigwedge_i(v_i=\mathrm{yes}). \]
A final decision must also be durably recorded and communicated. After voting yes, a participant that has heard no final decision cannot safely abort on its own. The coordinator may already have recorded a commit and delivered it elsewhere.
Two-phase commit explains how a prepared participant reaches a shared decision. Write-ahead logging is the local durability mechanism that lets it recover the promise it already made.
A crash tests the recovery rule
If a coordinator fails after durable commit but before notifying one participant, recovering the decision must lead the last participant to commit. An execution in which the coordinator never committed may look identical to that participant until it learns more. This uncertainty is why a basic two-phase protocol can block. Replicating decision records through a consensus protocol changes the failure assumptions. It still requires the transaction’s preparation conditions to hold.
Atomic commitment and isolation are independent obligations
Distributed MVCC can assign read timestamps and make each shard serve a compatible version. Snapshot visibility gives a stable set of reads, but a consistency proof must also rule out invalid patterns of concurrent reads and writes if serializability is promised. Two transactions updating different keys can each rely on an old observation of the other key. Coordinating one atomic outcome per transaction does not prevent that dependency cycle. See snapshot isolation and SSI, consensus, and the real-time specification in linearizability testing.[1][2]