SlideShare une entreprise Scribd logo
1  sur  113
Télécharger pour lire hors ligne
----------------
Impossibility
In the area of Distributed Computing.
----------------© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 1
NANCY LYNCH. A hundred impossiblility proofs for
distributed computing. In Proceedings of the Eighth
Annual ACM Symposium on Principles of Distributed
Computing, Edmonton, Alberta, Canada, August 1989
http://groups.csail.mit.edu/tds/papers/Lynch/
podc89.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 2
NANCY LYNCH. A hundred impossiblility proofs for
distributed computing. In Proceedings of the Eighth
Annual ACM Symposium on Principles of Distributed
Computing, Edmonton, Alberta, Canada, August 1989
http://groups.csail.mit.edu/tds/papers/Lynch/
podc89.pdf
"This talk is about impossibility results in the area of
distributed computing. I managed to count over 100 such
impossibility proofs! And my search wasn’t even very
systematic or exhaustive."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 3
ConsensusThe problem of reaching agreement among remote
processes
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 4
"The problem of reaching agreement among remote
processes is fundamental problems in distributed
computing."1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 5
"A well-known form of the problem is the “transaction
commit problem,” which arises in distributed database
systems"1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 6
Replicated State Machine
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 7
LESLIE LAMPORT. "Time, Clocks, and the Ordering of
Events in a Distributed System".
https://lamport.azurewebsites.net/pubs/time-clocks.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 8
"The synchronization is specified in terms of a State
Machine, consisting of a set E of possible events, a set S
of possible states, and a function f: E×S -> S. The
relation f(E, S) -> S' means that executing the event E
with the machine in state S causes the machine state to
change to S'."2
2 
LESLIE LAMPORT. Time, Clocks, and the Ordering of Events in a Distributed System. https://lamport.azurewebsites.net/
pubs/time-clocks.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 9
Node
State: S
A
B
C
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 10
Node
State: S
A
B
C
Client
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 11
Node
State: S
A
B
C
Client
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 12
Node
(S, e) -> S
A
B
C
Client
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 13
Node
State: S
A
B
C
Client
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 14
Node
State: S
A
B
C
D
Client
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 15
Node1 Node2 Node3
Events1 Events2 Events3
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 16
Node1 Node2 Node3
Events1 Events2 Events3
Client1 Client2 Client3
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 17
Node1 Node2 Node3
Events1
Aggrement1
Events2
Aggrement2
Events3
Aggrement3
Client1 Client2 Client3
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 18
LESLIE LAMPORT. "Time, Clocks, and the Ordering of
Events in a Distributed System".
https://lamport.azurewebsites.net/pubs/time-clocks.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 19
LESLIE LAMPORT. "Time, Clocks, and the Ordering of
Events in a Distributed System".
https://lamport.azurewebsites.net/pubs/time-clocks.pdf
"The problem of failure is a difficult one, and it is beyond
the scope of this paper to discuss it in any detail."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 20
LESLIE LAMPORT. "The Part-Time Parliament". ACM
Transactions on Computer Systems 16, 2 (May 1998)
http://lamport.azurewebsites.net/pubs/lamport-
paxos.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 21
LESLIE LAMPORT. "The Part-Time Parliament". ACM
Transactions on Computer Systems 16, 2 (May 1998)
http://lamport.azurewebsites.net/pubs/lamport-
paxos.pdf
"The Paxos algorithm for implementing a fault-tolerant
distributed system has been regarded as difficult to
understand, perhaps because the original presentation
was Greek to many readers"4
4 
LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121,
December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 22
LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT
News (Distributed Computing Column) 32, 4 (Whole
Number 121, December 2001)
https://www.microsoft.com/en-us/research/
publication/paxos-made-simple/
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 23
LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT
News (Distributed Computing Column) 32, 4 (Whole
Number 121, December 2001)
https://www.microsoft.com/en-us/research/
publication/paxos-made-simple/
"At the PODC 2001 conference, I got tired of everyone
saying how difficult it was to understand the Paxos
algorithm (...) the algorithm itself is very simple. So, I
cornered a couple of people at the conference and
explained the algorithm to them orally, with no paper.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 24
"Paxos is an algorithm that is used to achieve consensus
among a distributed set of computers that communicate
via an asynchronous network."4
4 
LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121,
December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 25
"Assume that agents can communicate with one another
by sending messages."4
"Agents operate at arbitrary speed, may fail by stopping,
and may restart."4
"Messages can take arbitrarily long to be delivered, can
be duplicated, and can be lost, but they are not
corrupted."4
4 
LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121,
December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 26
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 27
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 28
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S.
PATERSON. Impossibility of distributed consensus
with one faulty process. Journal of the ACM, 32(2):
374--382, April 1985
http://groups.csail.mit.edu/tds/papers/Lynch/
jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 29
"In this paper, we show the surprising result that no
completely asynchronous consensus protocol can
tolerate even a single unannounced process death. We do
not consider Byzantine failures, and we assume that the
message system is reliable - it delivers all messages
correctly and exactly once. Nevertheless, even with these
assumptions, the stopping of a single process at an
inopportune time can cause any distributed commit
protocol to fail to reach agreement." 1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 30
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 31
"Paxos is an algorithm that is used to achieve consensus
among a distributed set of computers that communicate
via an asynchronous network."1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 32
"Assume that agents can communicate with one another
by sending messages."4
"Agents operate at arbitrary speed, may fail by stopping,
and may restart."4
"Messages can take arbitrarily long to be delivered, can
be duplicated, and can be lost, but they are not
corrupted."4
4 
LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121,
December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 33
"The consensus problem involves an asynchronous
system of processes, some of which may be unreliable. The
problem is for the reliable processes to agree on a binary
value. In this paper, it is shown that every protocol for
this problem has the possibility of nontermination, even
with only one faulty process." 1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 34
"Our impossibility result applies to even a very weak
form of the consensus problem. (...) For the purpose of the
impossibility proof, we require only that some process
eventually make a decision."[^1 ]
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 35
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 36
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 37
Agenda
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S.
PATERSON. Impossibility of distributed consensus
with one faulty process. Journal of the ACM, 32(2):
374--382, April 1985
1. Detailed explanation of the theorem
2. How that applies to real world?
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 38
The Consensus
Our impossibility result applies to even a very weak
form of the consensus problem.
— Assume that every process starts with an initial
value in (0,1). A nonfaulty process decides on a
value in (0, 1) by entering an appropriate decision
state.
— For the purpose of the impossibility proof, we require
only that some process eventually make a decision.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 39
The Consensus
Our impossibility result applies to even a very weak
form of the consensus problem.
— "All nonfaulty processes that make a decision are
required to choose the same value."
— "The trivial solution in which, say, 0 is always chosen
is ruled out by stipulating that both 0 and 1 are
possible decision values."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 40
The Model
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 41
Paper assumes totally asynchronous model of
computation
— "processing is completely asynchronous; that is, we
make no assumptions about the relative speeds of
processes"
— "no ability to detect the death of a process, so it is
impossible for one process to tell whether another has
died (stopped entirely) or is just running very slowly."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 42
Paper assumes totally asynchronous model of message
delivery.
— "We make no assumptions (...) about the delay time in
delivering a message"
— "Every message is eventually delivered as long as the
destination process makes infinitely many attempts to
receive, but messages can be delayed, arbitrarily long,
and delivered out of order."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 43
Paper assumes totally asynchronous model of message
delivery.
— "(...) and we assume that the message system is
reliable it delivers all messages correctly and exactly
once"
— "An 'atomic broadcast' capability is assumed", so a
process can send the same message in one step to
all other processes with the knowledge that if any
nonfaulty process receives the message, then all the
nonfaulty processes will.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 44
Paper talks only about crash failures.
— "We do not consider Byzantine failures"
— "Of course, any protocol can be overwhelmed by
faults that are too frequent or too severe, so the best
that one can hope for is a protocol that is tolerant to
a prescribed number of 'expected' faults."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 45
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 46
In this paper, we show the
surprising result that no
completely asynchronous
consensus protocol can
tolerate even a single
unannounced process death.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 47
The Formalism
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 48
"A major obstacle to progress in the field of distributed
computation is that many of the important algorithms,
especially communications algorithms, seem to be too
complex for rigorous understanding.
Although the designers of these algorithms are often able
to convey an intuitive understanding of how their
algorithms work, it is often difficult to make this intuition
formal and precise."6
6 
NANCY LYNCH, MARK TUTTLE Hierarchical Correctness Proofs for Distributed Algorithms https://groups.csail.mit.edu/
tds/papers/Tuttle/Tuttle-thesis.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 49
The Formalism
A concurrent program can be simulated by a sequential
program that produces all interleavings of its threads
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 50
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 51
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 52
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 53
The Fromalism
"Processes are modeled as automata"1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 54
NANCY LYNCH, MARK TUTTLE "Hierarchical
Correctness Proofs for Distributed Algorithms"
https://groups.csail.mit.edu/tds/papers/Tuttle/Tuttle-
thesis.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 55
NANCY LYNCH, MARK TUTTLE "Hierarchical
Correctness Proofs for Distributed Algorithms"
https://groups.csail.mit.edu/tds/papers/Tuttle/Tuttle-
thesis.pdf
I/O Automaton
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 56
I/O Automaton
Automaton
Input
TransitionFunction
Output
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 57
I/O Automaton
Automaton
Input Input
TransitionFunction
Output
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 58
I/O Automaton
Automaton1
Automaton2
Input
TransitionFunction
Output InputInput
TransitionFunction
Output
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 59
"Processes are modeled as automata (with possibly
infinitely many states) that communicate by means of
messages.
In one atomic step a process can attempt to receive a
message, perform local computation on the basis of
whether or not a message was delivered to it (and if so,
which one), and send an arbitrary but finite set of
messages to other processes"1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 60
We need to formalise:
1. Process
2. Network
3. Combine those as a single model
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 61
Process
xp
TransitionFunction
yp
"A consensus protocol P is an
asynchronous system of N
processes (N > 2). Each process p
has a one-bit input register x, an
output register y with values in (b,
0, 1) ,and an unbounded amount
of internal storage."1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON.
Impossibility of distributed consensus with one faulty process. Journal
of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/
papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 62
MessageBuffer
Send Receive
Acts
Outgoing
"Processes communicate by
sending each other messages. A
message is a pair (p, m), where p
is the name of the destination
process and m is a 'message
value'. The message system
maintains a multiset, called the
message buffer, of messages that
have been sent but not yet
delivered. It supports two abstract
operations: Send(p, m) and
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON.
Impossibility of distributed consensus with one faulty process. Journal
of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/
papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 63
send(p, m): Places (p, m) in the messagebuffer
receive(p): Deletes some message(p, m) from the buffer
and returns m, in which casewe say (p, m) is delivered,
or returns the special null marker 0 and leavesthe buffer
unchanged.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 64
Thus, the message system acts nondeterministically,
subject only to the condition that if receive(p) is
performed infinitely many times, then every message(p,
m) in the messagebuffer is eventually delivered. In
particular, the message system is allowed to return 0 a
finite number of times in response to receive(p), even
though a message(p, m) is present in the buffer.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 65
Processes
P1
xp
TransitionFunction
yp
P2
xp
TransitionFunction
yp
P3
xp
TransitionFunction
yp
MessageBuffer
Send Receive
Acts
Outgoing
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 66
Internal State
"The values in the input and output registers, together with
the program counter and internal storage, comprise the
internal state. Initial states prescribe fixed starting values
for all but the input register; in particular, the output
register starts with value b."1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 67
Configuration
"A configuration of the system consists of the internal state
of each process, together with the contents of the message
buffer. An initial configuration is one in which each
process starts at an initial state and the message buffer is
empty."1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 68
"A step takes one configuration to another. Let C be a
configuration. The step occurs in two phases. First,
receive(p) is performed on the message buffer in C to
obtain a value m. Then, depending on p’s internal state in
C and on m, p enters a new internal state and sends a
finite set of messagesto other processes. Since
processesare deterministic, the step is completely
determined by the pair e = (p, m) which we call an event"1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 69
Schedule
A schedule from C is a finite or infinite sequence σ of
events that can be applied, in turn, starting from C. If σ
u is finite, we let σ(C) denote the resulting
configuration, which is said to be reachable from C.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 70
Faulty Process
"A process p is nonfaulty in a run provided that it takes
infinitely many steps, and it is faulty otherwise. "1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 71
Theorem"No consensus protocol is totally correct in spite of one
fault."1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 72
Lemma 1
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 73
LEMMA 1. Suppose that from some configuration C, the
schedules σ1, σ2 lead to configurations C1, C2,
respectively. If the sets of processes taking steps in σ1
and σ2, respectively, are disjoint, then σ2 can be
applied to C1 and σ2 can be applied to C2, and both
lead to the same configuration C3.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 74
PROOF. The result follows at once from the system
definition, since σ1 and σ2 do not interact.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 75
C
C1 C2
C3
σ1
σ2
σ2
σ1
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 76
C
C1 C2
C3
σ1
σ2
σ2
σ1
LEMMA 1. Suppose that from
some configuration C, the
schedules σ1, σ2 lead to
configurations C1, C2,
respectively. If the sets of
processes taking steps in σ1 and
σ2, respectively, are disjoint,
then σ2 can be applied to C1 and
σ2 can be applied to C2, and both
lead to the same configuration
C3.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 77
C
LEMMA 1. Suppose that from
some configuration C
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 78
C
C1 C2
σ1 σ2
LEMMA 1. Suppose that from
some configuration C, the
schedules σ1, σ2 lead to
configurations C1, C2,
respectively.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 79
C
C1 C2
σ1 σ2
LEMMA 1. Suppose that from
some configuration C, the
schedules σ1, σ2 lead to
configurations C1, C2,
respectively. If the sets of
processes taking steps in σ1 and
σ2, respectively, are disjoint,
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 80
C
C1 C2
C3
σ1
σ2
σ2
σ1
LEMMA 1. Suppose that from
some configuration C, the
schedules σ1, σ2 lead to
configurations C1, C2,
respectively. If the sets of
processes taking steps in σ1 and
σ2, respectively, are disjoint,
then σ2 can be applied to C1 and
σ2 can be applied to C2, and both
lead to the same configuration
C3.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 81
C
P1
Idle
P2
Idle
P3
Idle
P4
Idle
C1
P1
Running
P2
Idle
P3
Running
P4
Idle
C2
P1
Idle
P2
Running
P3
Idle
P4
Running
C3
P1
Running
P2
Running
P3
Running
P4
Running
σ1
σ2
σ2
σ1
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 82
C
C1 C2
C3
σ1
σ2
σ2
σ1
LEMMA 1. Suppose that from
some configuration C, the
schedules σ1, σ2 lead to
configurations C1, C2,
respectively. If the sets of
processes taking steps in σ1 and
σ2, respectively, are disjoint,
then σ2 can be applied to C1 and
σ2 can be applied to C2, and both
lead to the same configuration
C3.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 83
Theorem"No consensus protocol is totally correct in spite of one
fault."1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 84
Proof
"Assume to the contrary that P is a consensus protocol that
is totally correct in spite of one fault. We prove a sequence
of lemmas which eventually lead to a contradiction."1
1 
MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty
process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 85
Let C be a configuration and let V be the set of decision
values of configurations reachable from C.
C is bivalent if |V| = 2. C is univalent if |V| = 1
Let us say 0-valent or 1-valent according to the
corresponding decision value.
1. Lemma 2 - P has a bivalent initial configuration.
2. Lemma 3 - From bivalent configuration there is
always at least one reachable bivalent configuration
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 86
Lemma 2
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 87
Lemma 2: P has a bivalent initial configuration.
"An initial configuration is one in which each process
starts at an initial state and the message buffer is empty."
"Initial states prescribe fixed starting values for all but the
input register; in particular, the output register starts with
value b."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 88
Lemma 2: P has a bivalent initial configuration.
C(0) C(0) C(0) C(1) C(1) C(1)
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 89
Lemma 2: P has a bivalent initial configuration.
C(0) C(0) C(0) C(1) C(1) C(1)
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 90
Lemma 2: P has a bivalent initial configuration.
C(0) C(0) C(0) C(1) C(1) C(1)
"Now consider some deciding run from CO in which
process p takes no steps, and let σ be the associated
schedule. Then σ can be applied to C1 also, and
corresponding configurations in the two runs are identical
except for the internal state of process p."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 91
Lemma 3
Let C be a bivalent configuration of P, and let e = (p, m)
be an event that is applicable to C. Let ℂ be the set of
configurations reachable from C without applying e,
and let 𝔻 = e(ℂ), then 𝔻 contains a bivalent
configuration.
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 92
Lemma 3
Consider two neighbors configurations: C0, C1 ∈ ℂ,
such that e(C0) = D0 and e(C1) = D1
Neighbors so C1 = e’(C0) where e’ = (p’, m’).
Two cases:
1. p == p'
2. p === p'
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 93
Lemma 3, Case 1. p == p'
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 94
Lemma 3, Case 1. p == p'
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 95
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 96
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 97
Safety and liveness
"Safety: Informally, an algorithm is safe if nothing bad
ever happens. (...)
Liveness: By contrast, an algorithm is live if eventually
something good happens."9
9 
NANCY LYNCH AND SETH GILBERT Perspectives on the CAP Theorem https://groups.csail.mit.edu/tds/papers/Gilbert/
Brewer2.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 98
"If a system is wholly synchronous, consensus can be
solved, i.e., the trade-off between safety and liveness can
be avoided. Notably, consensus requires f + 1 rounds, if up
to f servers may crash. Since consensus is impossible in an
asynchronous system if there is even one crash failure, this
motivates the question: how much synchrony is needed to
solve consensus? And do real systems provide that
necessary level of synchrony?9
"
9 
NANCY LYNCH AND SETH GILBERT Perspectives on the CAP Theorem https://groups.csail.mit.edu/tds/papers/Gilbert/
Brewer2.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 99
DOLEV, D., DWORK, C., AND STOCKMEYER, L. On the
minimal synchronism needed for distributed
consensus. J. ACM34, 1 (Jan. 1987)
https://dl.acm.org/doi/10.1145/7531.7533
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 100
"Most notably, they introduced the idea of eventual
synchrony: a system may experience some periods of
synchrony and some periods of asynchrony, but as long as
it eventually stabilizes and maintains synchrony for a
sufficiently long period of time, we can solve consensus."
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 101
CYNTHIA DWORK, LARRY STOCKMEYER AND NANCY
LYNCH Consensus in the Presence of Partial
Synchrony
https://groups.csail.mit.edu/tds/papers/Lynch/
jacm88.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 102
"It’s easy to construct a scenario in which two proposers
each keep issuing a sequence of proposals with increasing
numbers, none of which are ever chosen."4
4 
LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121,
December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 103
Examples of successful implementations of Paxos
1. Google Chubby (https://research.google/pubs/
pub27897/)
2. Event Store (https://eventstore.com/)
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 104
NANCY LYNCH AND SETH GILBERT Perspectives on
the CAP Theorem
https://groups.csail.mit.edu/tds/papers/Gilbert/
Brewer2.pdf
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 105
So, wait. Is asynchronous model completely not
thereotically possible in real world?
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 106
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 107
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 108
Before we go...
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 109
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 110
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 111
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 112
Thank you!
@EncodePanda
© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 113

Contenu connexe

Similaire à Distributed Computing Impossibility Proofs

Distributed Systems - Like It Or Not
Distributed Systems - Like It Or NotDistributed Systems - Like It Or Not
Distributed Systems - Like It Or NotTheo Schlossnagle
 
At the Crossroads of HPC and Cloud Computing with Openstack
At the Crossroads of HPC and Cloud Computing with OpenstackAt the Crossroads of HPC and Cloud Computing with Openstack
At the Crossroads of HPC and Cloud Computing with OpenstackRyan Aydelott
 
OpenStack Explained: Learn OpenStack architecture and the secret of a success...
OpenStack Explained: Learn OpenStack architecture and the secret of a success...OpenStack Explained: Learn OpenStack architecture and the secret of a success...
OpenStack Explained: Learn OpenStack architecture and the secret of a success...Giuseppe Paterno'
 
Automated Experimentation in Social Informatics
Automated Experimentation in Social InformaticsAutomated Experimentation in Social Informatics
Automated Experimentation in Social InformaticsAliaksandr Birukou
 
ZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed SystemsZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed SystemsGokhan Boranalp
 
510Lec01-Overview.pptx
510Lec01-Overview.pptx510Lec01-Overview.pptx
510Lec01-Overview.pptxKrosumLabs1
 
Laboratory manual for seismic data processing courses using the seismic unix
Laboratory manual for seismic data processing courses using the seismic unixLaboratory manual for seismic data processing courses using the seismic unix
Laboratory manual for seismic data processing courses using the seismic unixDante Leon Cortes
 
The Power of the Cloud, and Global Risk Modelling in the Open
The Power of the Cloud, and Global Risk Modelling in the OpenThe Power of the Cloud, and Global Risk Modelling in the Open
The Power of the Cloud, and Global Risk Modelling in the OpenJoshua McKenty
 
Is there anybody out there?
Is there anybody out there?Is there anybody out there?
Is there anybody out there?Manuel Bernhardt
 
Patching Mr Robot: Mitigating IoT-Related Cyber-social Disasters by getting F...
Patching Mr Robot: Mitigating IoT-Related Cyber-social Disasters by getting F...Patching Mr Robot: Mitigating IoT-Related Cyber-social Disasters by getting F...
Patching Mr Robot: Mitigating IoT-Related Cyber-social Disasters by getting F...Eugene Siow
 
2600 v02 n11 (november 1985)
2600 v02 n11 (november 1985)2600 v02 n11 (november 1985)
2600 v02 n11 (november 1985)Felipe Prado
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxPratik Joshi
 
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICESKEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICESMykola Novik
 
A Biological Internet?: Eywa
A Biological Internet?: EywaA Biological Internet?: Eywa
A Biological Internet?: EywaEugene Siow
 
Sql or NoSql: that is the question...
Sql or NoSql: that is the question...Sql or NoSql: that is the question...
Sql or NoSql: that is the question...alikonweb
 

Similaire à Distributed Computing Impossibility Proofs (20)

Distributed Systems - Like It Or Not
Distributed Systems - Like It Or NotDistributed Systems - Like It Or Not
Distributed Systems - Like It Or Not
 
At the Crossroads of HPC and Cloud Computing with Openstack
At the Crossroads of HPC and Cloud Computing with OpenstackAt the Crossroads of HPC and Cloud Computing with Openstack
At the Crossroads of HPC and Cloud Computing with Openstack
 
OpenStack Explained: Learn OpenStack architecture and the secret of a success...
OpenStack Explained: Learn OpenStack architecture and the secret of a success...OpenStack Explained: Learn OpenStack architecture and the secret of a success...
OpenStack Explained: Learn OpenStack architecture and the secret of a success...
 
Automated Experimentation in Social Informatics
Automated Experimentation in Social InformaticsAutomated Experimentation in Social Informatics
Automated Experimentation in Social Informatics
 
ZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed SystemsZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed Systems
 
Computer cluster
Computer clusterComputer cluster
Computer cluster
 
Computer cluster
Computer clusterComputer cluster
Computer cluster
 
afternoon3.pdf
afternoon3.pdfafternoon3.pdf
afternoon3.pdf
 
510Lec01-Overview.pptx
510Lec01-Overview.pptx510Lec01-Overview.pptx
510Lec01-Overview.pptx
 
Laboratory manual for seismic data processing courses using the seismic unix
Laboratory manual for seismic data processing courses using the seismic unixLaboratory manual for seismic data processing courses using the seismic unix
Laboratory manual for seismic data processing courses using the seismic unix
 
Hardware7
Hardware7Hardware7
Hardware7
 
The Power of the Cloud, and Global Risk Modelling in the Open
The Power of the Cloud, and Global Risk Modelling in the OpenThe Power of the Cloud, and Global Risk Modelling in the Open
The Power of the Cloud, and Global Risk Modelling in the Open
 
Latex crash course
Latex crash courseLatex crash course
Latex crash course
 
Is there anybody out there?
Is there anybody out there?Is there anybody out there?
Is there anybody out there?
 
Patching Mr Robot: Mitigating IoT-Related Cyber-social Disasters by getting F...
Patching Mr Robot: Mitigating IoT-Related Cyber-social Disasters by getting F...Patching Mr Robot: Mitigating IoT-Related Cyber-social Disasters by getting F...
Patching Mr Robot: Mitigating IoT-Related Cyber-social Disasters by getting F...
 
2600 v02 n11 (november 1985)
2600 v02 n11 (november 1985)2600 v02 n11 (november 1985)
2600 v02 n11 (november 1985)
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linux
 
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICESKEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
KEY CONCEPTS FOR SCALABLE STATEFUL SERVICES
 
A Biological Internet?: Eywa
A Biological Internet?: EywaA Biological Internet?: Eywa
A Biological Internet?: Eywa
 
Sql or NoSql: that is the question...
Sql or NoSql: that is the question...Sql or NoSql: that is the question...
Sql or NoSql: that is the question...
 

Plus de Pawel Szulc

Getting acquainted with Lens
Getting acquainted with LensGetting acquainted with Lens
Getting acquainted with LensPawel Szulc
 
Maintainable Software Architecture in Haskell (with Polysemy)
Maintainable Software Architecture in Haskell (with Polysemy)Maintainable Software Architecture in Haskell (with Polysemy)
Maintainable Software Architecture in Haskell (with Polysemy)Pawel Szulc
 
Painless Haskell
Painless HaskellPainless Haskell
Painless HaskellPawel Szulc
 
Trip with monads
Trip with monadsTrip with monads
Trip with monadsPawel Szulc
 
Trip with monads
Trip with monadsTrip with monads
Trip with monadsPawel Szulc
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineersPawel Szulc
 
RChain - Understanding Distributed Calculi
RChain - Understanding Distributed CalculiRChain - Understanding Distributed Calculi
RChain - Understanding Distributed CalculiPawel Szulc
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineersPawel Szulc
 
Understanding distributed calculi in Haskell
Understanding distributed calculi in HaskellUnderstanding distributed calculi in Haskell
Understanding distributed calculi in HaskellPawel Szulc
 
Software engineering the genesis
Software engineering  the genesisSoftware engineering  the genesis
Software engineering the genesisPawel Szulc
 
Make your programs Free
Make your programs FreeMake your programs Free
Make your programs FreePawel Szulc
 
Going bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesGoing bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesPawel Szulc
 
“Going bananas with recursion schemes for fixed point data types”
“Going bananas with recursion schemes for fixed point data types”“Going bananas with recursion schemes for fixed point data types”
“Going bananas with recursion schemes for fixed point data types”Pawel Szulc
 
Writing your own RDD for fun and profit
Writing your own RDD for fun and profitWriting your own RDD for fun and profit
Writing your own RDD for fun and profitPawel Szulc
 
The cats toolbox a quick tour of some basic typeclasses
The cats toolbox  a quick tour of some basic typeclassesThe cats toolbox  a quick tour of some basic typeclasses
The cats toolbox a quick tour of some basic typeclassesPawel Szulc
 
Introduction to type classes
Introduction to type classesIntroduction to type classes
Introduction to type classesPawel Szulc
 
Functional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenFunctional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenPawel Szulc
 
Apache spark workshop
Apache spark workshopApache spark workshop
Apache spark workshopPawel Szulc
 
Introduction to type classes in 30 min
Introduction to type classes in 30 minIntroduction to type classes in 30 min
Introduction to type classes in 30 minPawel Szulc
 
Real world gobbledygook
Real world gobbledygookReal world gobbledygook
Real world gobbledygookPawel Szulc
 

Plus de Pawel Szulc (20)

Getting acquainted with Lens
Getting acquainted with LensGetting acquainted with Lens
Getting acquainted with Lens
 
Maintainable Software Architecture in Haskell (with Polysemy)
Maintainable Software Architecture in Haskell (with Polysemy)Maintainable Software Architecture in Haskell (with Polysemy)
Maintainable Software Architecture in Haskell (with Polysemy)
 
Painless Haskell
Painless HaskellPainless Haskell
Painless Haskell
 
Trip with monads
Trip with monadsTrip with monads
Trip with monads
 
Trip with monads
Trip with monadsTrip with monads
Trip with monads
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineers
 
RChain - Understanding Distributed Calculi
RChain - Understanding Distributed CalculiRChain - Understanding Distributed Calculi
RChain - Understanding Distributed Calculi
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineers
 
Understanding distributed calculi in Haskell
Understanding distributed calculi in HaskellUnderstanding distributed calculi in Haskell
Understanding distributed calculi in Haskell
 
Software engineering the genesis
Software engineering  the genesisSoftware engineering  the genesis
Software engineering the genesis
 
Make your programs Free
Make your programs FreeMake your programs Free
Make your programs Free
 
Going bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesGoing bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data types
 
“Going bananas with recursion schemes for fixed point data types”
“Going bananas with recursion schemes for fixed point data types”“Going bananas with recursion schemes for fixed point data types”
“Going bananas with recursion schemes for fixed point data types”
 
Writing your own RDD for fun and profit
Writing your own RDD for fun and profitWriting your own RDD for fun and profit
Writing your own RDD for fun and profit
 
The cats toolbox a quick tour of some basic typeclasses
The cats toolbox  a quick tour of some basic typeclassesThe cats toolbox  a quick tour of some basic typeclasses
The cats toolbox a quick tour of some basic typeclasses
 
Introduction to type classes
Introduction to type classesIntroduction to type classes
Introduction to type classes
 
Functional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heavenFunctional Programming & Event Sourcing - a pair made in heaven
Functional Programming & Event Sourcing - a pair made in heaven
 
Apache spark workshop
Apache spark workshopApache spark workshop
Apache spark workshop
 
Introduction to type classes in 30 min
Introduction to type classes in 30 minIntroduction to type classes in 30 min
Introduction to type classes in 30 min
 
Real world gobbledygook
Real world gobbledygookReal world gobbledygook
Real world gobbledygook
 

Dernier

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Dernier (20)

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Distributed Computing Impossibility Proofs

  • 1. ---------------- Impossibility In the area of Distributed Computing. ----------------© Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 1
  • 2. NANCY LYNCH. A hundred impossiblility proofs for distributed computing. In Proceedings of the Eighth Annual ACM Symposium on Principles of Distributed Computing, Edmonton, Alberta, Canada, August 1989 http://groups.csail.mit.edu/tds/papers/Lynch/ podc89.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 2
  • 3. NANCY LYNCH. A hundred impossiblility proofs for distributed computing. In Proceedings of the Eighth Annual ACM Symposium on Principles of Distributed Computing, Edmonton, Alberta, Canada, August 1989 http://groups.csail.mit.edu/tds/papers/Lynch/ podc89.pdf "This talk is about impossibility results in the area of distributed computing. I managed to count over 100 such impossibility proofs! And my search wasn’t even very systematic or exhaustive." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 3
  • 4. ConsensusThe problem of reaching agreement among remote processes © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 4
  • 5. "The problem of reaching agreement among remote processes is fundamental problems in distributed computing."1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 5
  • 6. "A well-known form of the problem is the “transaction commit problem,” which arises in distributed database systems"1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 6
  • 7. Replicated State Machine © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 7
  • 8. LESLIE LAMPORT. "Time, Clocks, and the Ordering of Events in a Distributed System". https://lamport.azurewebsites.net/pubs/time-clocks.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 8
  • 9. "The synchronization is specified in terms of a State Machine, consisting of a set E of possible events, a set S of possible states, and a function f: E×S -> S. The relation f(E, S) -> S' means that executing the event E with the machine in state S causes the machine state to change to S'."2 2  LESLIE LAMPORT. Time, Clocks, and the Ordering of Events in a Distributed System. https://lamport.azurewebsites.net/ pubs/time-clocks.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 9
  • 10. Node State: S A B C © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 10
  • 11. Node State: S A B C Client © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 11
  • 12. Node State: S A B C Client © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 12
  • 13. Node (S, e) -> S A B C Client © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 13
  • 14. Node State: S A B C Client © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 14
  • 15. Node State: S A B C D Client © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 15
  • 16. Node1 Node2 Node3 Events1 Events2 Events3 © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 16
  • 17. Node1 Node2 Node3 Events1 Events2 Events3 Client1 Client2 Client3 © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 17
  • 18. Node1 Node2 Node3 Events1 Aggrement1 Events2 Aggrement2 Events3 Aggrement3 Client1 Client2 Client3 © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 18
  • 19. LESLIE LAMPORT. "Time, Clocks, and the Ordering of Events in a Distributed System". https://lamport.azurewebsites.net/pubs/time-clocks.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 19
  • 20. LESLIE LAMPORT. "Time, Clocks, and the Ordering of Events in a Distributed System". https://lamport.azurewebsites.net/pubs/time-clocks.pdf "The problem of failure is a difficult one, and it is beyond the scope of this paper to discuss it in any detail." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 20
  • 21. LESLIE LAMPORT. "The Part-Time Parliament". ACM Transactions on Computer Systems 16, 2 (May 1998) http://lamport.azurewebsites.net/pubs/lamport- paxos.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 21
  • 22. LESLIE LAMPORT. "The Part-Time Parliament". ACM Transactions on Computer Systems 16, 2 (May 1998) http://lamport.azurewebsites.net/pubs/lamport- paxos.pdf "The Paxos algorithm for implementing a fault-tolerant distributed system has been regarded as difficult to understand, perhaps because the original presentation was Greek to many readers"4 4  LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121, December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/ © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 22
  • 23. LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121, December 2001) https://www.microsoft.com/en-us/research/ publication/paxos-made-simple/ © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 23
  • 24. LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121, December 2001) https://www.microsoft.com/en-us/research/ publication/paxos-made-simple/ "At the PODC 2001 conference, I got tired of everyone saying how difficult it was to understand the Paxos algorithm (...) the algorithm itself is very simple. So, I cornered a couple of people at the conference and explained the algorithm to them orally, with no paper. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 24
  • 25. "Paxos is an algorithm that is used to achieve consensus among a distributed set of computers that communicate via an asynchronous network."4 4  LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121, December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/ © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 25
  • 26. "Assume that agents can communicate with one another by sending messages."4 "Agents operate at arbitrary speed, may fail by stopping, and may restart."4 "Messages can take arbitrarily long to be delivered, can be duplicated, and can be lost, but they are not corrupted."4 4  LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121, December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/ © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 26
  • 27. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 27
  • 28. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 28
  • 29. MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2): 374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/ jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 29
  • 30. "In this paper, we show the surprising result that no completely asynchronous consensus protocol can tolerate even a single unannounced process death. We do not consider Byzantine failures, and we assume that the message system is reliable - it delivers all messages correctly and exactly once. Nevertheless, even with these assumptions, the stopping of a single process at an inopportune time can cause any distributed commit protocol to fail to reach agreement." 1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 30
  • 31. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 31
  • 32. "Paxos is an algorithm that is used to achieve consensus among a distributed set of computers that communicate via an asynchronous network."1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 32
  • 33. "Assume that agents can communicate with one another by sending messages."4 "Agents operate at arbitrary speed, may fail by stopping, and may restart."4 "Messages can take arbitrarily long to be delivered, can be duplicated, and can be lost, but they are not corrupted."4 4  LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121, December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/ © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 33
  • 34. "The consensus problem involves an asynchronous system of processes, some of which may be unreliable. The problem is for the reliable processes to agree on a binary value. In this paper, it is shown that every protocol for this problem has the possibility of nontermination, even with only one faulty process." 1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 34
  • 35. "Our impossibility result applies to even a very weak form of the consensus problem. (...) For the purpose of the impossibility proof, we require only that some process eventually make a decision."[^1 ] © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 35
  • 36. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 36
  • 37. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 37
  • 38. Agenda MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2): 374--382, April 1985 1. Detailed explanation of the theorem 2. How that applies to real world? © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 38
  • 39. The Consensus Our impossibility result applies to even a very weak form of the consensus problem. — Assume that every process starts with an initial value in (0,1). A nonfaulty process decides on a value in (0, 1) by entering an appropriate decision state. — For the purpose of the impossibility proof, we require only that some process eventually make a decision. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 39
  • 40. The Consensus Our impossibility result applies to even a very weak form of the consensus problem. — "All nonfaulty processes that make a decision are required to choose the same value." — "The trivial solution in which, say, 0 is always chosen is ruled out by stipulating that both 0 and 1 are possible decision values." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 40
  • 41. The Model © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 41
  • 42. Paper assumes totally asynchronous model of computation — "processing is completely asynchronous; that is, we make no assumptions about the relative speeds of processes" — "no ability to detect the death of a process, so it is impossible for one process to tell whether another has died (stopped entirely) or is just running very slowly." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 42
  • 43. Paper assumes totally asynchronous model of message delivery. — "We make no assumptions (...) about the delay time in delivering a message" — "Every message is eventually delivered as long as the destination process makes infinitely many attempts to receive, but messages can be delayed, arbitrarily long, and delivered out of order." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 43
  • 44. Paper assumes totally asynchronous model of message delivery. — "(...) and we assume that the message system is reliable it delivers all messages correctly and exactly once" — "An 'atomic broadcast' capability is assumed", so a process can send the same message in one step to all other processes with the knowledge that if any nonfaulty process receives the message, then all the nonfaulty processes will. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 44
  • 45. Paper talks only about crash failures. — "We do not consider Byzantine failures" — "Of course, any protocol can be overwhelmed by faults that are too frequent or too severe, so the best that one can hope for is a protocol that is tolerant to a prescribed number of 'expected' faults." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 45
  • 46. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 46
  • 47. In this paper, we show the surprising result that no completely asynchronous consensus protocol can tolerate even a single unannounced process death. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 47
  • 48. The Formalism © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 48
  • 49. "A major obstacle to progress in the field of distributed computation is that many of the important algorithms, especially communications algorithms, seem to be too complex for rigorous understanding. Although the designers of these algorithms are often able to convey an intuitive understanding of how their algorithms work, it is often difficult to make this intuition formal and precise."6 6  NANCY LYNCH, MARK TUTTLE Hierarchical Correctness Proofs for Distributed Algorithms https://groups.csail.mit.edu/ tds/papers/Tuttle/Tuttle-thesis.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 49
  • 50. The Formalism A concurrent program can be simulated by a sequential program that produces all interleavings of its threads © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 50
  • 51. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 51
  • 52. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 52
  • 53. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 53
  • 54. The Fromalism "Processes are modeled as automata"1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 54
  • 55. NANCY LYNCH, MARK TUTTLE "Hierarchical Correctness Proofs for Distributed Algorithms" https://groups.csail.mit.edu/tds/papers/Tuttle/Tuttle- thesis.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 55
  • 56. NANCY LYNCH, MARK TUTTLE "Hierarchical Correctness Proofs for Distributed Algorithms" https://groups.csail.mit.edu/tds/papers/Tuttle/Tuttle- thesis.pdf I/O Automaton © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 56
  • 57. I/O Automaton Automaton Input TransitionFunction Output © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 57
  • 58. I/O Automaton Automaton Input Input TransitionFunction Output © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 58
  • 60. "Processes are modeled as automata (with possibly infinitely many states) that communicate by means of messages. In one atomic step a process can attempt to receive a message, perform local computation on the basis of whether or not a message was delivered to it (and if so, which one), and send an arbitrary but finite set of messages to other processes"1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 60
  • 61. We need to formalise: 1. Process 2. Network 3. Combine those as a single model © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 61
  • 62. Process xp TransitionFunction yp "A consensus protocol P is an asynchronous system of N processes (N > 2). Each process p has a one-bit input register x, an output register y with values in (b, 0, 1) ,and an unbounded amount of internal storage."1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/ papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 62
  • 63. MessageBuffer Send Receive Acts Outgoing "Processes communicate by sending each other messages. A message is a pair (p, m), where p is the name of the destination process and m is a 'message value'. The message system maintains a multiset, called the message buffer, of messages that have been sent but not yet delivered. It supports two abstract operations: Send(p, m) and 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/ papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 63
  • 64. send(p, m): Places (p, m) in the messagebuffer receive(p): Deletes some message(p, m) from the buffer and returns m, in which casewe say (p, m) is delivered, or returns the special null marker 0 and leavesthe buffer unchanged. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 64
  • 65. Thus, the message system acts nondeterministically, subject only to the condition that if receive(p) is performed infinitely many times, then every message(p, m) in the messagebuffer is eventually delivered. In particular, the message system is allowed to return 0 a finite number of times in response to receive(p), even though a message(p, m) is present in the buffer. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 65
  • 67. Internal State "The values in the input and output registers, together with the program counter and internal storage, comprise the internal state. Initial states prescribe fixed starting values for all but the input register; in particular, the output register starts with value b."1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 67
  • 68. Configuration "A configuration of the system consists of the internal state of each process, together with the contents of the message buffer. An initial configuration is one in which each process starts at an initial state and the message buffer is empty."1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 68
  • 69. "A step takes one configuration to another. Let C be a configuration. The step occurs in two phases. First, receive(p) is performed on the message buffer in C to obtain a value m. Then, depending on p’s internal state in C and on m, p enters a new internal state and sends a finite set of messagesto other processes. Since processesare deterministic, the step is completely determined by the pair e = (p, m) which we call an event"1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 69
  • 70. Schedule A schedule from C is a finite or infinite sequence σ of events that can be applied, in turn, starting from C. If σ u is finite, we let σ(C) denote the resulting configuration, which is said to be reachable from C. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 70
  • 71. Faulty Process "A process p is nonfaulty in a run provided that it takes infinitely many steps, and it is faulty otherwise. "1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 71
  • 72. Theorem"No consensus protocol is totally correct in spite of one fault."1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 72
  • 73. Lemma 1 © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 73
  • 74. LEMMA 1. Suppose that from some configuration C, the schedules σ1, σ2 lead to configurations C1, C2, respectively. If the sets of processes taking steps in σ1 and σ2, respectively, are disjoint, then σ2 can be applied to C1 and σ2 can be applied to C2, and both lead to the same configuration C3. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 74
  • 75. PROOF. The result follows at once from the system definition, since σ1 and σ2 do not interact. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 75
  • 76. C C1 C2 C3 σ1 σ2 σ2 σ1 © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 76
  • 77. C C1 C2 C3 σ1 σ2 σ2 σ1 LEMMA 1. Suppose that from some configuration C, the schedules σ1, σ2 lead to configurations C1, C2, respectively. If the sets of processes taking steps in σ1 and σ2, respectively, are disjoint, then σ2 can be applied to C1 and σ2 can be applied to C2, and both lead to the same configuration C3. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 77
  • 78. C LEMMA 1. Suppose that from some configuration C © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 78
  • 79. C C1 C2 σ1 σ2 LEMMA 1. Suppose that from some configuration C, the schedules σ1, σ2 lead to configurations C1, C2, respectively. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 79
  • 80. C C1 C2 σ1 σ2 LEMMA 1. Suppose that from some configuration C, the schedules σ1, σ2 lead to configurations C1, C2, respectively. If the sets of processes taking steps in σ1 and σ2, respectively, are disjoint, © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 80
  • 81. C C1 C2 C3 σ1 σ2 σ2 σ1 LEMMA 1. Suppose that from some configuration C, the schedules σ1, σ2 lead to configurations C1, C2, respectively. If the sets of processes taking steps in σ1 and σ2, respectively, are disjoint, then σ2 can be applied to C1 and σ2 can be applied to C2, and both lead to the same configuration C3. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 81
  • 83. C C1 C2 C3 σ1 σ2 σ2 σ1 LEMMA 1. Suppose that from some configuration C, the schedules σ1, σ2 lead to configurations C1, C2, respectively. If the sets of processes taking steps in σ1 and σ2, respectively, are disjoint, then σ2 can be applied to C1 and σ2 can be applied to C2, and both lead to the same configuration C3. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 83
  • 84. Theorem"No consensus protocol is totally correct in spite of one fault."1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 84
  • 85. Proof "Assume to the contrary that P is a consensus protocol that is totally correct in spite of one fault. We prove a sequence of lemmas which eventually lead to a contradiction."1 1  MICHAEL J. FISCHER, NANCY A. LYNCH, MICHAEL S. PATERSON. Impossibility of distributed consensus with one faulty process. Journal of the ACM, 32(2):374--382, April 1985 http://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 85
  • 86. Let C be a configuration and let V be the set of decision values of configurations reachable from C. C is bivalent if |V| = 2. C is univalent if |V| = 1 Let us say 0-valent or 1-valent according to the corresponding decision value. 1. Lemma 2 - P has a bivalent initial configuration. 2. Lemma 3 - From bivalent configuration there is always at least one reachable bivalent configuration © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 86
  • 87. Lemma 2 © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 87
  • 88. Lemma 2: P has a bivalent initial configuration. "An initial configuration is one in which each process starts at an initial state and the message buffer is empty." "Initial states prescribe fixed starting values for all but the input register; in particular, the output register starts with value b." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 88
  • 89. Lemma 2: P has a bivalent initial configuration. C(0) C(0) C(0) C(1) C(1) C(1) © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 89
  • 90. Lemma 2: P has a bivalent initial configuration. C(0) C(0) C(0) C(1) C(1) C(1) © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 90
  • 91. Lemma 2: P has a bivalent initial configuration. C(0) C(0) C(0) C(1) C(1) C(1) "Now consider some deciding run from CO in which process p takes no steps, and let σ be the associated schedule. Then σ can be applied to C1 also, and corresponding configurations in the two runs are identical except for the internal state of process p." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 91
  • 92. Lemma 3 Let C be a bivalent configuration of P, and let e = (p, m) be an event that is applicable to C. Let ℂ be the set of configurations reachable from C without applying e, and let 𝔻 = e(ℂ), then 𝔻 contains a bivalent configuration. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 92
  • 93. Lemma 3 Consider two neighbors configurations: C0, C1 ∈ ℂ, such that e(C0) = D0 and e(C1) = D1 Neighbors so C1 = e’(C0) where e’ = (p’, m’). Two cases: 1. p == p' 2. p === p' © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 93
  • 94. Lemma 3, Case 1. p == p' © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 94
  • 95. Lemma 3, Case 1. p == p' © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 95
  • 96. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 96
  • 97. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 97
  • 98. Safety and liveness "Safety: Informally, an algorithm is safe if nothing bad ever happens. (...) Liveness: By contrast, an algorithm is live if eventually something good happens."9 9  NANCY LYNCH AND SETH GILBERT Perspectives on the CAP Theorem https://groups.csail.mit.edu/tds/papers/Gilbert/ Brewer2.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 98
  • 99. "If a system is wholly synchronous, consensus can be solved, i.e., the trade-off between safety and liveness can be avoided. Notably, consensus requires f + 1 rounds, if up to f servers may crash. Since consensus is impossible in an asynchronous system if there is even one crash failure, this motivates the question: how much synchrony is needed to solve consensus? And do real systems provide that necessary level of synchrony?9 " 9  NANCY LYNCH AND SETH GILBERT Perspectives on the CAP Theorem https://groups.csail.mit.edu/tds/papers/Gilbert/ Brewer2.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 99
  • 100. DOLEV, D., DWORK, C., AND STOCKMEYER, L. On the minimal synchronism needed for distributed consensus. J. ACM34, 1 (Jan. 1987) https://dl.acm.org/doi/10.1145/7531.7533 © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 100
  • 101. "Most notably, they introduced the idea of eventual synchrony: a system may experience some periods of synchrony and some periods of asynchrony, but as long as it eventually stabilizes and maintains synchrony for a sufficiently long period of time, we can solve consensus." © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 101
  • 102. CYNTHIA DWORK, LARRY STOCKMEYER AND NANCY LYNCH Consensus in the Presence of Partial Synchrony https://groups.csail.mit.edu/tds/papers/Lynch/ jacm88.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 102
  • 103. "It’s easy to construct a scenario in which two proposers each keep issuing a sequence of proposals with increasing numbers, none of which are ever chosen."4 4  LESLIE LAMPORT. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32, 4 (Whole Number 121, December 2001) https://www.microsoft.com/en-us/research/publication/paxos-made-simple/ © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 103
  • 104. Examples of successful implementations of Paxos 1. Google Chubby (https://research.google/pubs/ pub27897/) 2. Event Store (https://eventstore.com/) © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 104
  • 105. NANCY LYNCH AND SETH GILBERT Perspectives on the CAP Theorem https://groups.csail.mit.edu/tds/papers/Gilbert/ Brewer2.pdf © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 105
  • 106. So, wait. Is asynchronous model completely not thereotically possible in real world? © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 106
  • 107. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 107
  • 108. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 108
  • 109. Before we go... © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 109
  • 110. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 110
  • 111. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 111
  • 112. © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 112
  • 113. Thank you! @EncodePanda © Pawel Szulc, @EncodePanda, paul.szulc@gmail.com 113