Classifying Configurations Bivalent Initial Configurations Happen

Classifying Configurations
Bivalent Initial
Configurations Happen
0-valent: A configuration C is 0-valent if some process has
decided 0 in C, or if all configurations accessible from C
are 0-valent
1-valent: A configuration C is 1-valent if some process has
decided 1 in C, or if all configurations accessible from C
are 1-valent
Lemma 1
There is a bivalent initial configuration
Bivalent: A configuration C is bivalent if some of the
configurations accessible from it are 0-valent while others
are 1-valent
Proof
• Suppose algorithm A solves
consensus in the presence of 1
crash failure
• Let Ij be the initial configuration
in which the first j bi’s are 1
• I0 is 0-valent
• In is 1-valent
• By contradiction, suppose no
bivalent
• Let k be smallest index such that
Ik is 1-valent
• Obviously, Ik-1 is 0-valent
• Suppose pk crashes before taking
any step.
• Since A solves consensus even
with one crash failure, there is a
finite schedule S applicable to Ik
that has no steps of pk and such
that some process decides in S(Ik)
• S is also applicable to Ik-1 (why?)
CONTRADICTION…
Commutativity Lemma
Lemma 2
Let S1 and S2 be schedules applicable to some
configuration C, and suppose that the set of
processes taking steps in S1 is disjoint from the set of
processes taking steps in S2 .
Then, S1; S2 and S2; S1 are both sequences applicable to
C, and they lead to the same configuration.
1
Procrastination Lemma
Proof Sketch - 1
• By contradiction, assume
there is an e for which no
such S exists
• Then, e(C) is monovalent;
WLOG assume 0-valent
Lemma 3
Let C be bivalent, and let e be a step applicable to C.
Then, there is a (possibly empty) schedule S not
containing e such that e(S(C)) is bivalent
C
e
e
E
1
0
e
1
• Consider configuration e(D).
• By assumption, e(D) cannot be
bivalent (otherwise we would
have proved the Procrastination
Lemma)
• Since E is accessible from e(D),
e(D) is monovalent, and E is 1valent, then e(D) is 1-valent
S0 (e-free)
D
0
e
E
S1
1
C
e
D
0
If mini Lemma holds, on the
“path” from C to D there
must be two neighboring
configurations A and B and a
step f such that
• B = f (A)
• e(A) is 0-valent
• e(B) is 1-valent
S0 (e-free)
C
S0 (e-free)
1
• If S1 is e-free, then D = E
e
Proof Sketch - 3
S1
C
S1
D
0
There exists an e-free
schedule S0 such that
D = S0(C)
and
e(D) is 1-valent
• Otherwise, let S0 be the largest
e-free prefix of S1
• Since C is bivalent, there exists
a schedule S1 such that E = S1(C)
is 1-valent
e
Mini Lemma:
Proof Sketch- 2
Proof of mini Lemma.
S0 (e-free)
C
A
e
e
e
e
E
1
0
1
0
0
e
f B
e
0
1
D
e
1
2
Proof Sketch - 4
• Consider now A and
B = f (A)
• Claim: The same processes
p must take steps e and f
– Suppose not
– By Commutativity lemma,
e(B) = e(f(A)) = f(e(A))
– Impossible since e(B) is 1valent and e(A) is 0-valent
C
A
e
e
0
e
0
f
B
D
e
f
0
e
e
0
1
1
Proof Sketch - 5
• Since our protocol tolerates
a failure, there is a schedule
ρ applicable to A such that:
– R = ρ(A)
– Some process decides in R
– p does not take any steps in ρ
f
B
e
1
ρ
ρ
R
e
?
0
f
e
1
• Since ρ(e(B)) is accessible from
R, and ρ(e(B)) is 1-valent, R
cannot be 0-valent
R
?
Proof Sketch - 7
Cannot be 0:
• Consider e(B) = e( f (A))
• By mini Lemma, we know it
is 1-valent
• Because it contains no steps
of p, ρ is applicable to e(B)
• The resulting configuration is
1-valent
• By Commutativity Lemma,
ρ(e( f (A))) = e( f (ρ(A))) =
= e( f (R))
ρ
• We show that the decision
value in R can be neither 0
nor 1!
Proof Sketch - 6
A
A
Cannot be 1:
A
f
e
0
B
e
1
ρ
ρ
ρ
R
e
?
0
0
1
• Consider e(A)
• By construction, it is 0-valent
• Because it contains no steps
of p, ρ is applicable to e(A)
• The resulting configuration is
0-valent
f
e
1
• By Commutativity Lemma,
ρ(e (A)) = e (ρ(A)) = e(R)
• Since ρ(e(A)) is accessible from
R, and ρ(e(A)) is 0-valent, R
cannot be 1-valent
Cannot decide in R: contradiction
3
Proving the FLP
Impossibility Result
How can one get around FLP?
Weaken the problem
Theorem
There is no deterministic protocol that solves Consensus in
a message-passing asynchronous system in which at
most one process may fail by crashing
• By Lemma 1, there exists an
initial bivalent configuration Ibiv
• Consider any ordering
pl1 ,…, pln of p 1,…, pn
• Pick any applicable step
e1 = ( p l1 , m1 )
• Apply Procrastination lemma to
obtain another bivalent
configuration C1biv = e1 (S1 ( Ibiv ))
• Pick a step e2 = ( p l2 ,m2 ) applicable
to C1biv
• Apply again Procrastination lemma
to obtain another bivalent
2
1
configuration Cbiv = e2 (S2 (Cbiv ))
• Continue as before in a round-robin
fashion. How do we choose a step?
• We have built an unacceptable run!
1. Weaken termination
• use randomization to terminate
with probability 1
2. Approximate agreement
• ε - agreement
– real-valued inputs and outputs
– agreement within real-valued
small positive tolerance ε
• k-set agreement
3. Constrain input values
• characterize the set of input values
for which agreement is possible
Strengthen the system model
• Introduce failure detectors
• distinguish between crashed
processes and very slow processes
– Agreement: In any execution,
there is a subset W of the set of
input values, |W| =k, s.t. all
decision values are in W
– Validity: In any execution, any
decision value for any process
is the input value of some
process
The Big Picture
• Does randomization make for more powerful algorithms?
The Triumph
of Randomization
• Does randomization expand the class of problems solvable in
polynomial time?
• Does randomization help compute problems fast in parallel in the
PRAM model?
You tell me!
4
The Triumph of Randomization?
Well, at least for distributed computations!
• no deterministic 1-crash-resilient solution to Consensus
• f resilient randomized solution to consensus (f < n/2)
for crash failures
• randomized solution for Consensus exist even for
Byzantine failures!
5