Skip to content
About
Main content

Atomicity becomes an availability liability

Why does unanimity make atomic commit multiply unavailability, and which impossibility results bound every protocol?

Distribution turns atomicity into an availability liability

In Transaction mechanics the designated atomic event and the writes it spoke for shared fate: one node, one log, one crash. Recovery could always find the designated record. The thing that lost the writes also lost the record, and the thing that kept the record also kept the writes.

Distribution breaks exactly that. The writes now sit on machines that fail independently of the machine holding the decision. "Atomicity over n items is atomicity over one item" still applies, since one designated write still means all the others, but the designated write can now be reached only through a message that may not arrive. Distribution does not change how atomicity is implemented.

Two impossibility results

Two results bound every protocol in this article. State them first.

  • The Two Generals problem. No finite number of messages over an unreliable channel gives two parties certainty that the other acted, because the last message can always be lost; this is why exactly-once delivery does not exist.
  • Skeen's result. No protocol is both safe and non-blocking in an with failures. (An asynchronous system is one where messages can take any amount of time, so a slow node cannot be told apart from a dead one.) Safe means no two participants decide differently; non-blocking means survivors can always finish without waiting for the failed node to come back.

Every mechanism below chooses which one to bend and decides who pays.

Consensus needs a majority; atomic commit needs unanimity

Consensus is the problem of getting several machines to agree on one value (used for replication, leader election). Its validity condition is "the decided value was proposed by someone". So any majority can decide, and a minority can be ignored. Atomic commit is the problem of getting all participants to either or a transaction together. Its validity condition is "commit if and only if every participant voted yes", because any single participant might have a local reason to refuse: a constraint violation, a lock conflict, a full disk. That stronger condition is not a detail. It is the entire cost.

over 5 replicasAtomic commit over 10 participants
Decision ruleMajority (3 of 5)Unanimity (10 of 10)
Availability at 0.999 each~0.999999990.999¹⁰ ≈ 0.99
Effect of one unreachable nodeNoneAbort at best, block at worst

Worked arithmetic for the right column: each participant is up 99.9% of the time. All ten must be up: 0.999¹⁰ = e^(10 × ln 0.999) ≈ e^(−0.01) ≈ 0.990. Downtime grows from 0.1% to 1%, which is ten times the downtime of one component, from the same components, purely because of the decision rule. (For the left column, five replicas at 0.999 that fail only when three or more are down give about 1 − 10 × 0.001³ = 0.99999999 under an independent model; correlated failures make the real figure lower.) Aⁿ also assumes that participants fail independently, and in reality they share racks, zones, deploys and configuration. For a unanimity protocol, correlation reduces how often you block (failures arrive together) while making each episode larger and simultaneous: the independent model is pessimistic about frequency and optimistic about severity, the opposite of its effect on quorum systems.

Two-phase commit is not "consensus with two rounds". The confusion is common, and it hides the one number that matters.

availability of one participant
participants that must all be up
each 99.9%each 99.99%
Data table
Availability of an all-participants commit, by participants
Participants nseriesAvailability
1each 99.9%99.9%
1.05each 99.9%99.9%
1.1each 99.9%99.9%
1.16each 99.9%99.9%
1.22each 99.9%99.9%
1.28each 99.9%99.9%
1.34each 99.9%99.9%
1.41each 99.9%99.9%
1.48each 99.9%99.9%
1.55each 99.9%99.8%
1.63each 99.9%99.8%
1.71each 99.9%99.8%
1.8each 99.9%99.8%
1.89each 99.9%99.8%
1.98each 99.9%99.8%
2.08each 99.9%99.8%
2.19each 99.9%99.8%
2.3each 99.9%99.8%
2.41each 99.9%99.8%
2.53each 99.9%99.7%
2.66each 99.9%99.7%
2.79each 99.9%99.7%
2.93each 99.9%99.7%
3.08each 99.9%99.7%
3.23each 99.9%99.7%
3.4each 99.9%99.7%
3.57each 99.9%99.6%
3.74each 99.9%99.6%
3.93each 99.9%99.6%
4.13each 99.9%99.6%
4.34each 99.9%99.6%
4.55each 99.9%99.5%
4.78each 99.9%99.5%
5.02each 99.9%99.5%
5.27each 99.9%99.5%
5.54each 99.9%99.4%
5.81each 99.9%99.4%
6.11each 99.9%99.4%
6.41each 99.9%99.4%
6.73each 99.9%99.3%
7.07each 99.9%99.3%
7.43each 99.9%99.3%
7.8each 99.9%99.2%
8.19each 99.9%99.2%
8.6each 99.9%99.1%
9.03each 99.9%99.1%
9.48each 99.9%99.1%
9.96each 99.9%99%
10.5each 99.9%99%
11each 99.9%98.9%
11.5each 99.9%98.9%
12.1each 99.9%98.8%
12.7each 99.9%98.7%
13.4each 99.9%98.7%
14each 99.9%98.6%
14.7each 99.9%98.5%
15.5each 99.9%98.5%
16.2each 99.9%98.4%
17.1each 99.9%98.3%
17.9each 99.9%98.2%
18.8each 99.9%98.1%
19.7each 99.9%98%
20.7each 99.9%97.9%
21.8each 99.9%97.8%
22.9each 99.9%97.7%
24each 99.9%97.6%
25.2each 99.9%97.5%
26.5each 99.9%97.4%
27.8each 99.9%97.3%
29.2each 99.9%97.1%
30.7each 99.9%97%
32.2each 99.9%96.8%
33.8each 99.9%96.7%
35.5each 99.9%96.5%
37.3each 99.9%96.3%
39.2each 99.9%96.2%
41.1each 99.9%96%
43.2each 99.9%95.8%
45.3each 99.9%95.6%
47.6each 99.9%95.3%
50each 99.9%95.1%
1each 99.99%100%
1.05each 99.99%100%
1.1each 99.99%100%
1.16each 99.99%100%
1.22each 99.99%100%
1.28each 99.99%100%
1.34each 99.99%100%
1.41each 99.99%100%
1.48each 99.99%100%
1.55each 99.99%100%
1.63each 99.99%100%
1.71each 99.99%100%
1.8each 99.99%100%
1.89each 99.99%100%
1.98each 99.99%100%
2.08each 99.99%100%
2.19each 99.99%100%
2.3each 99.99%100%
2.41each 99.99%100%
2.53each 99.99%100%
2.66each 99.99%100%
2.79each 99.99%100%
2.93each 99.99%100%
3.08each 99.99%100%
3.23each 99.99%100%
3.4each 99.99%100%
3.57each 99.99%100%
3.74each 99.99%100%
3.93each 99.99%100%
4.13each 99.99%100%
4.34each 99.99%100%
4.55each 99.99%100%
4.78each 99.99%100%
5.02each 99.99%99.9%
5.27each 99.99%99.9%
5.54each 99.99%99.9%
5.81each 99.99%99.9%
6.11each 99.99%99.9%
6.41each 99.99%99.9%
6.73each 99.99%99.9%
7.07each 99.99%99.9%
7.43each 99.99%99.9%
7.8each 99.99%99.9%
8.19each 99.99%99.9%
8.6each 99.99%99.9%
9.03each 99.99%99.9%
9.48each 99.99%99.9%
9.96each 99.99%99.9%
10.5each 99.99%99.9%
11each 99.99%99.9%
11.5each 99.99%99.9%
12.1each 99.99%99.9%
12.7each 99.99%99.9%
13.4each 99.99%99.9%
14each 99.99%99.9%
14.7each 99.99%99.9%
15.5each 99.99%99.8%
16.2each 99.99%99.8%
17.1each 99.99%99.8%
17.9each 99.99%99.8%
18.8each 99.99%99.8%
19.7each 99.99%99.8%
20.7each 99.99%99.8%
21.8each 99.99%99.8%
22.9each 99.99%99.8%
24each 99.99%99.8%
25.2each 99.99%99.7%
26.5each 99.99%99.7%
27.8each 99.99%99.7%
29.2each 99.99%99.7%
30.7each 99.99%99.7%
32.2each 99.99%99.7%
33.8each 99.99%99.7%
35.5each 99.99%99.6%
37.3each 99.99%99.6%
39.2each 99.99%99.6%
41.1each 99.99%99.6%
43.2each 99.99%99.6%
45.3each 99.99%99.5%
47.6each 99.99%99.5%
50each 99.99%99.5%

Distributed atomicity is the local trick performed at a distance, and the distance converts the designated write from a bookkeeping device into a single point of reachability.