CS 425 / ECE 428 Distributed Systems Fall 2016: Lecture 16-A: Impossibility of Consensus
CS 425 / ECE 428 Distributed Systems Fall 2016: Lecture 16-A: Impossibility of Consensus
CS 425 / ECE 428 Distributed Systems Fall 2016: Lecture 16-A: Impossibility of Consensus
Distributed Systems
Fall 2016
Indranil Gupta (Indy)
Oct 13, 2016
Lecture 16-A: Impossibility of Consensus
All slides © IG
Give it a thought
6
What is Consensus? (2)
• Every process contributes a value
• Goal is to have all processes decide same (some) value
• Decision once made can’t be changed
• There might be other constraints
• Validity = if everyone proposes same value, then that’s
what’s decided
• Integrity = decided value must have been proposed by
some process
• Non-triviality = there is at least one initial system state
that leads to each of the all-0’s or all-1’s outcomes
7
Why is it Important?
• Many problems in distributed systems are
equivalent to (or harder than) consensus!
• Perfect Failure Detection
• Leader election (select exactly one leader, and every
alive process knows about it)
• Agreement (harder than consensus)
13
Consensus in Synchronous System
Possible to achieve!
• Impossible to achieve!
18
Network
p p’
send(p’,m)
receive(p’)
may return null
“Network”
19
States
• State of a process
• Configuration=global state. Collection of states,
one for each process; alongside state of the global
buffer.
• Each Event (different from Lamport events) is
atomic and consists of three steps
• receipt of a message by a process (say p)
• processing of message (may change recipient’s state)
• sending out of all necessary messages by p
• Schedule: sequence of events
20
Configuration C
C
C
Event e’=(p’,m’)
Schedule s=(e’,e’’)
C’
C’’
Event e’’=(p’’,m’’)
C’’
Equivalent 21
Lemma 1
Disjoint schedules are
commutative
C
s2
Schedule s1
s1 and s2 involve C’
disjoint sets of
receiving processes, Schedule s2
and are each applicable s1
on C C’’
22
Easier Consensus Problem
23
Easier Consensus Problem
• Let config. C have a set of decision values V
reachable from it
• If |V| = 2, config. C is bivalent
• If |V| = 1, config. C is 0-valent or 1-valent, as is
the case
24
What the FLP proof shows
1. There exists an initial
configuration that is bivalent
1 1 0 1 0 1
29
Lemma 3
30
Lemma 3
bivalent
[don’t apply
C event e=(p,m)]
e e e e e
D
32
Claim. Set D contains a bivalent config.
Proof. By contradiction. That is,
suppose D has only 0- and 1- valent
bivalent
states (and no bivalent ones)
• There are states D0 and D1 in D, and
C0 and C1 in C such that C [don’t apply
event e=(p,m)]
– D0 is 0-valent, D1 is 1-valent e e e e e
– D0=C0 foll. by e=(p,m)
– D1=C1 foll. by e=(p,m)
– And C1 = C0 followed by some event D
e’=(p’,m’)
(why?)
33
Proof. (contd.) C0 e’
e
• Case I: p’ is not p D0 C1
Why? (Lemma 1)
But D0 is then bivalent!
bivalent
C [don’t apply
event e=(p,m)]
e e e e e
D 34
Proof. (contd.) C0
e’
e
• Case I: p’ is not p C1 e
D0
sch. s
• Case II: p’ same as p D1
sch. s sch. s
A
bivalent e
(e’,e)
E1
E0
C [don’t apply sch. s
event e=(p,m)] • finite
e e e e e • deciding run from C0
• p takes no steps
36
Putting it all Together
• Lemma 2: There exists an initial configuration that is
bivalent
• Lemma 3: Starting from a bivalent config., there is
always another bivalent config. that is reachable
37
Summary
• Consensus Problem
• Agreement in distributed systems
• Solution exists in synchronous system model (e.g.,
supercomputer)
• Impossible to solve in an asynchronous system (e.g.,
Internet, Web)
• Key idea: with even one (adversarial) crash-stop process
failure, there are always sequences of events for the system
to decide any which way
• Holds true regardless of whatever algorithm you choose!
• FLP impossibility proof
38
• One of the most fundamental results in
Announcements
• Midterm Statistics (on-campus students only)
min, max, median, average, stdev
• Survey: Most students found the exam “Alright” (48%) to “Difficult” (33%)
• 9% thought it was super-difficult, and 10% thought easy or super-easy
• MP3, HW3 out today
• Start early!
39
Collect your Midterms and MP2
Reports
40