IMPOSSIBILITY OF CONSENSUS IN ASYNCHRONOUS ENVIRONMENTS
Ellis Michael
I MPOSSIBILITY OF C ONSENSUS IN A SYNCHRONOUS E NVIRONMENTS Ellis - - PowerPoint PPT Presentation
I MPOSSIBILITY OF C ONSENSUS IN A SYNCHRONOUS E NVIRONMENTS Ellis Michael C ONSENSUS processes, all of which have an input value from some domain. Processes output a value by calling decide ( ). Non-faulty processes continue correctly
Ellis Michael
π processes, all of which have an input value from some domain. Processes output a value by calling decide(π€). Non-faulty processes continue correctly executing protocol steps forever. We denote the number of faulty processes π.
correct process decides a value π€, some process had π€ as its input.
π processes, all of which have an input value from {0, 1}. Processes output a value by calling decide(π€). Non-faulty processes continue correctly executing protocol steps forever. We denote the number of faulty processes π. Here, we only consider crash failures.
decides a value π€, some process had π€ as its input.
π processes, all of which have an input value from {0, 1}. Processes output a value by calling decide(π€). Non-faulty processes continue correctly executing protocol steps forever. We denote the number of faulty processes π. Here, we only consider crash failures.
decides a value π€, some process had π€ as its input.
If you can solve consensus, you can solve binary consensus.
Aside: Both safety and liveness properties are necessary to create a meaningful specification!
Theorem (FLP Impossibility Result): In an asynchronous environment in which a single process can fail by crashing, there does not exist a protocol which solves binary consensus.
indistinguishable from slow processes.
safety.
in your labs; timers are just messages sent from process to itself).
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
(π, π3)
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
(π, π3)
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
(π, π3)
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
process (even if there are messages for it in the network).
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
process (even if there are messages for it in the network).
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
process (even if there are messages for it in the network).
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
process (even if there are messages for it in the network).
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
process (even if there are messages for it in the network).
eventually received. (Stronger assumption than usual!)
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
in your labs; timers are just messages sent from process to itself).
a multi-set (i.e., messages aren't duplicated by network). Processes only send finitely-many messages in a single step.
process (even if there are messages for it in the network).
eventually received. (Stronger assumption than usual!)
Message Buffer (network)
π1 π2 π3 π4 π5 ... ππ
Makes the impossibility result is stronger!
A configuration (usually denoted π·) consists of the states of all processes and the state of the message buffer. An event is the delivery of a single message (or β ) to a process. An event is applicable to π· if it is a β or a message in π·'s message buffer. A configuration π·ΚΉ is reachable from π· if there is a (possibly empty) sequence of applicable events starting from π· that results in π·ΚΉ. Configuration π· is decided if at least one process has decided in π·.
A run is an infinite sequence of events starting from an initial configuration. A process is non-faulty in a run if it takes infinitely many steps. It is faulty otherwise. A run is admissible if at most one process is faulty and every message sent to a non-faulty process is eventually delivered.
In other words, the FLP theorem states that any protocol for binary consensus either doesn't satisfy safety or allows for an admissible run in which no value is ever decided (i.e., that it doesn't satisfy termination, the liveness property). From now on, we'll consider a safe and live binary consensus protocol and show a contradiction.
By assumption of safety, no configuration has processes deciding different values. π· is 0-valent if there are decided configurations reachable from π· that decide 0, but none that decide 1. 1-valency is defined in the analogous way. π· is univalent if it is 0-valent or 1-valent. π· is bivalent if both 0-deciding and 1-deciding are reachable from π·.
π·
By assumption of safety, no configuration has processes deciding different values. π· is 0-valent if there are decided configurations reachable from π· that decide 0, but none that decide 1. 1-valency is defined in the analogous way. π· is univalent if it is 0-valent or 1-valent. π· is bivalent if both 0-deciding and 1-deciding are reachable from π·.
π·
1
Observation: bivalent configurations are not themselves decided.
Observation: 1-valent and bivalent configurations are not reachable from 0-valent configurations. 0-valent and bivalent configurations are not reachable from 1-valent configurations.
Lemma 1: If two sequences of events, π1 and π2, are taken by disjoint sets of processes from configuration π·, then π1(π2(π·)) = π2(π1(π·)).
π·
π1 π1 π2 π2
p1 p2 p3 p4
π·
Lemma 2: There exists a bivalent initial configuration.
Lemma 2: There exists a bivalent initial configuration.
0βπ1 0βπ2 0βπ3 0βπn ...
Lemma 2: There exists a bivalent initial configuration.
0-valent!
0βπ1 0βπ2 0βπ3 0βπn ...
Lemma 2: There exists a bivalent initial configuration.
0-valent!
0βπ1 0βπ2 0βπ3 0βπn ... 1βπ1 1βπ2 1βπ3 1βπn ...
Lemma 2: There exists a bivalent initial configuration.
0-valent! 1-valent!
0βπ1 0βπ2 0βπ3 0βπn ... 1βπ1 1βπ2 1βπ3 1βπn ...
Lemma 2: There exists a bivalent initial configuration.
0-valent! 1-valent!
0βπ1 0βπ2 0βπ3 0βπn ... 1βπ1 0βπ2 0βπ3 0βπn ... 1βπ1 1βπ2 1βπ3 1βπn ...
Lemma 2: There exists a bivalent initial configuration.
0-valent! 1-valent!
0βπ1 0βπ2 0βπ3 0βπn ... 1βπ1 0βπ2 0βπ3 0βπn ... 1βπ1 1βπ2 0βπ3 0βπn ... 1βπ1 1βπ2 1βπ3 1βπn ...
Lemma 2: There exists a bivalent initial configuration.
0-valent! 1-valent!
0βπ1 0βπ2 0βπ3 0βπn ... 1βπ1 0βπ2 0βπ3 0βπn ... 1βπ1 1βπ2 0βπ3 0βπn ... 1βπ1 1βπ2 1βπ3 1βπn ...
Lemma 2: There exists a bivalent initial configuration.
There must be 0-valent π·0 and β¨ 1-valent π·1 that differ only in the input value of a single process, π.
1βπ β 1 is decided 0βπ β 0 is decided
Lemma 2: There exists a bivalent initial configuration.
There must be 0-valent π·0 and β¨ 1-valent π·1 that differ only in the input value of a single process, π. What if π crashes at the beginning?
1βπ β 1 is decided 0βπ β 0 is decided
Lemma 2: There exists a bivalent initial configuration.
There must be 0-valent π·0 and β¨ 1-valent π·1 that differ only in the input value of a single process, π. What if π crashes at the beginning? These two configurations are indistinguishable to the rest of the processes.
1βπ β 1 is decided 0βπ β 0 is decided
Lemma 3 (The Delay Lemma): For every bivalent configuration, π·, and every event applicable to π·, π, there exists a sequence of applicable events π such that π·ΚΉ = π(π(π·)) is bivalent.
π· π·ΚΉ
π π
Constructing the non-terminating execution:
Constructing the non-terminating execution: 1: Let π· be a bivalent initial configuration (Lemma 2).
Constructing the non-terminating execution: 1: Let π· be a bivalent initial configuration (Lemma 2).
π·
Constructing the non-terminating execution: 1: Let π· be a bivalent initial configuration (Lemma 2). 2: For the process which least recently took a step, take the oldest message left in the network for it (β if none exists), π. By Lemma 3, we first take a sequence of steps π and then deliver π and remain in a bivalent configuration.
π·
Constructing the non-terminating execution: 1: Let π· be a bivalent initial configuration (Lemma 2). 2: For the process which least recently took a step, take the oldest message left in the network for it (β if none exists), π. By Lemma 3, we first take a sequence of steps π and then deliver π and remain in a bivalent configuration.
π· π·ΚΉ
π π
Constructing the non-terminating execution: 1: Let π· be a bivalent initial configuration (Lemma 2). 2: For the process which least recently took a step, take the oldest message left in the network for it (β if none exists), π. By Lemma 3, we first take a sequence of steps π and then deliver π and remain in a bivalent configuration. 3: Go to 2.
π· π·ΚΉ
π π
Constructing the non-terminating execution: 1: Let π· be a bivalent initial configuration (Lemma 2). 2: For the process which least recently took a step, take the oldest message left in the network for it (β if none exists), π. By Lemma 3, we first take a sequence of steps π and then deliver π and remain in a bivalent configuration. 3: Go to 2.
π· π·ΚΉ
π π
π·ΚΉΚΉ
πΚΉ πΚΉ
Constructing the non-terminating execution: 1: Let π· be a bivalent initial configuration (Lemma 2). 2: For the process which least recently took a step, take the oldest message left in the network for it (β if none exists), π. By Lemma 3, we first take a sequence of steps π and then deliver π and remain in a bivalent configuration. 3: Go to 2.
π· π·ΚΉ
π π
π·ΚΉΚΉ
πΚΉ πΚΉ
. . .
Constructing the non-terminating execution: 1: Let π· be a bivalent initial configuration (Lemma 2). 2: For the process which least recently took a step, take the oldest message left in the network for it (β if none exists), π. By Lemma 3, we first take a sequence of steps π and then deliver π and remain in a bivalent configuration. 3: Go to 2.
Every process takes infinitely many steps (i.e., no process is faulty). Every message sent is eventually delivered. This is an admissible execution. We take infinitely many steps, and no process decides! The protocol fails to meet the termination property of the spec.
π· π·ΚΉ
π π
π·ΚΉΚΉ
πΚΉ πΚΉ
. . .
Consider a bivalent configuration, π·, and an applicable event, π.
Consider a bivalent configuration, π·, and an applicable event, π. If π(π·) is bivalent, then we're done.
Consider a bivalent configuration, π·, and an applicable event, π. If π(π·) is bivalent, then we're done. Otherwise, let π be the set of events reachable from π· without applying π and π be π(π) = { π(π·) : π· β π } (i.e., the set of all configurations reachable from π· where π was the last event taken).
Consider a bivalent configuration, π·, and an applicable event, π. If π(π·) is bivalent, then we're done. Otherwise, let π be the set of events reachable from π· without applying π and π be π(π) = { π(π·) : π· β π } (i.e., the set of all configurations reachable from π· where π was the last event taken).
π·
π
Consider a bivalent configuration, π·, and an applicable event, π. If π(π·) is bivalent, then we're done. Otherwise, let π be the set of events reachable from π· without applying π and π be π(π) = { π(π·) : π· β π } (i.e., the set of all configurations reachable from π· where π was the last event taken).
π·
π π
Consider a bivalent configuration, π·, and an applicable event, π. If π(π·) is bivalent, then we're done. Otherwise, let π be the set of events reachable from π· without applying π and π be π(π) = { π(π·) : π· β π } (i.e., the set of all configurations reachable from π· where π was the last event taken).
π·
π π π
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't.
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π .
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
same valency since it's not bivalent by assumption).
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
same valency since it's not bivalent by assumption).
π π π
π·
We want to show π contains a bivalent configuration. Suppose, for the sake of contradiction, that it doesn't. Then, we first show there must exist both 0-valent and 1-valent configurations in π . Because π· is bivalent, there exist reachable 0-valent and 1-valent configurations. For each, this configuration is either:
same valency since it's not bivalent by assumption).
π π π
π·
Now, consider the valency of π(π·). Without loss
π π π
π·
Now, consider the valency of π(π·). Without loss
Because there are 1-valent configurations in π , there must be a path from π· to one of these.
π π π
π·
Now, consider the valency of π(π·). Without loss
Because there are 1-valent configurations in π , there must be a path from π· to one of these.
π π π
π·
1
Now, consider the valency of π(π·). Without loss
Because there are 1-valent configurations in π , there must be a path from π· to one of these. Then, there must exist adjacent configurations, π·0 and π·1, where π(π·0) is 0-valent and π(π·1) is 1-valent.
π π π
π·
1
Now, consider the valency of π(π·). Without loss
Because there are 1-valent configurations in π , there must be a path from π· to one of these. Then, there must exist adjacent configurations, π·0 and π·1, where π(π·0) is 0-valent and π(π·1) is 1-valent.
π π π
π·
1 1
π·1 π·0
Now, consider the valency of π(π·). Without loss
Because there are 1-valent configurations in π , there must be a path from π· to one of these. Then, there must exist adjacent configurations, π·0 and π·1, where π(π·0) is 0-valent and π(π·1) is 1-valent. Let's call the event that takes π·0 to π·1 π.
π π π
π·
1 1
π·1 π·0
Now, consider the valency of π(π·). Without loss
Because there are 1-valent configurations in π , there must be a path from π· to one of these. Then, there must exist adjacent configurations, π·0 and π·1, where π(π·0) is 0-valent and π(π·1) is 1-valent. Let's call the event that takes π·0 to π·1 π.
π π π
π·
1 1
π·1 π·0
π
Almost done! First, we will show that the processes taking steps π and π must be the same process.
1
π·1 π·0
π π π
Almost done! First, we will show that the processes taking steps π and π must be the same process. If not, π is applicable to π(π·0) and results in a 1-valent configuration (Lemma 1).
1
π·1 π·0
π π π
Almost done! First, we will show that the processes taking steps π and π must be the same process. If not, π is applicable to π(π·0) and results in a 1-valent configuration (Lemma 1).
1
π·1 π·0
π π π π
Almost done! First, we will show that the processes taking steps π and π must be the same process. If not, π is applicable to π(π·0) and results in a 1-valent configuration (Lemma 1). Let's call the process taking these steps π.
1
π·1 π·0
π π π π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. 1
π·1 π·0
π π π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. 1
π·1 π·0
π π π
π΅
π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. By Lemma 1, we get the commutative diagram on the right. A decided configuration, π΅, can reach both 1-valent and 0-valent configurations. 1
π·1 π·0
π π π
π΅
π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. By Lemma 1, we get the commutative diagram on the right. A decided configuration, π΅, can reach both 1-valent and 0-valent configurations. 1
π·1 π·0
π π π
π΅
π π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. By Lemma 1, we get the commutative diagram on the right. A decided configuration, π΅, can reach both 1-valent and 0-valent configurations. 1
π·1 π·0
π π π
π΅
π
1
π π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. By Lemma 1, we get the commutative diagram on the right. A decided configuration, π΅, can reach both 1-valent and 0-valent configurations. 1
π·1 π·0
π π π
π΅
π
1
π π π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. By Lemma 1, we get the commutative diagram on the right. A decided configuration, π΅, can reach both 1-valent and 0-valent configurations. 1
π·1 π·0
π π π
π΅
π
1
π π π π π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. By Lemma 1, we get the commutative diagram on the right. A decided configuration, π΅, can reach both 1-valent and 0-valent configurations. As desired, contradiction! 1
π·1 π·0
π π π
π΅
π
1
π π π π π
Since the protocol is correct and tolerates
decided configuration, π΅, without π taking steps. By Lemma 1, we get the commutative diagram on the right. A decided configuration, π΅, can reach both 1-valent and 0-valent configurations. As desired, contradiction! 1
π·1 π·0
π π π
π΅
π
1
π π π π π
Options:
(Paxos); implies that no configuration is ever dead
1 (Ben-Or)
synchronous system)
decision values
decide on sets of values, all decision sets are comparable by β
and write to a register
decision values
decide on sets of values, all decision sets are comparable by β
and write to a register
Still can't guarantee liveness when π β₯ π
decision values
decide on sets of values, all decision sets are comparable by β
and write to a register
Still can't guarantee liveness when π β₯ π Solvable, can guarantee both safety and liveness! Of questionable utility.
decision values
decide on sets of values, all decision sets are comparable by β
and write to a register
Still can't guarantee liveness when π β₯ π Solvable, can guarantee both safety and liveness! Of questionable utility. Also solvable! And useful!