









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A series of lecture notes from computer science 328: distributed systems, focusing on consensus and agreement in distributed systems. The notes cover the concepts of consensus, requirements for consensus, consensus algorithms, and interactive consistency. The document also includes examples and proofs of correctness for these concepts.
Typology: Study notes
1 / 15
This page cannot be seen from the preview
Don't miss anything!










e.g. synchronized action (go / abort)
(^) Process failure – process crash (fail stop failure), arbitrary failure. (^) Communication failure – lost or corrupted messages.
(^) All Pi start in an “undecided” state. (^) Each Pi proposes a value vi from a set D and communicates it to some or all other processes. (^) A consensus is reached if all non failed processes agree on the same value, d. (^) Each non failed Pi sets its decision variable to d and changes its state to “decided.”
For a system with at most f processes crashing, the algorithm proceeds in f+1 rounds (with timeout), using basic multicast. Valuesri: the set of proposed values known to Pi at the beginning of round r. Initially Values^0 i = {} ; Values^1 i = {vi} for round = 1 to f+1 do multicast ( Values ri – Valuesr 1i ) Values r+1i Valuesri for each Vj received Values r+1i = Values r+1i ∪ Vj end end di = minimum( Values f+2i )
P
P2 P
P Crashed
ConsensusAlg.
V 1 = go
V 2 = go V 3 = go
V 4 = abort
d 1 ← go
d 2 ← go d 3 ←^ go
P
P2 P
P Crashed
ConsensusAlg.
V 1 = 5
V 2 = 7 V 3 = 2
V 4 = ⊥
d 1 ← (5,7,2, -)
Consensus
d 2 ← (5,7,2, -) d^3 ←^ (5,7,2, -)
Interactive Consistency
Two waring armies, Red army is larger but divided (^) Red army can win by synchronized attack, if not coordinated they’ll lose (^) Timing is critical. They cannot wait for long (supplies run out, get weaker) (^) R1 sends a message to R2 with “time of attack” (^) R1 not sure R2 received it (^) R2 may get concerned R1 is not sure (^) R2 may send ACK, but that may get lost (^) the message from R1 may be intercepted by B
No solution if the comm. medium is unreliable
R1 R B
p 1 (Commander)
p 2 p 3
1:v 1:v 2:1:v 3:1:u
p 1 (Commander)
p 2 p 3
1:w 1:x 2:1:w 3:1:x Faulty processes are shown shaded If a solution exists, process p2 is bound to decide on value v when the commander is correct, by the integrity condition. If we accept that no algorithm can possibly distinguish between the two scenarios, p2 must also choose the value sent by the commander in the right scenario.
P1 P
P3 P
1
1
1
3
3
3
4
4
4
x
y
z
Step 1
P1 P
P3 P
1,x,3,
x,w,t,s
1,x,3,4 z,mp,x^ y,x,w,p 1,x,3,
1,y,3,
1,z,3,
1,z,3,4 1,z,3,4^ 1,y,3,
1,y,3,
Step 2
Step 3 2: <x,w,t,s> 1:<1,x,3,4> P1 3:<1,z,3,4> P2 3: <1,z,3,4> 4: <1,y,3,4> 4: <1,y,3,4> 1:<1,x,3,4> 1:<1,x,3,4> P3 2: <x,w,t,s> P4 2: <x,w,t,s> 4: <1,y,3,4> 3: <1,z,3,4>
Step 4
P1 <1,?,3,4> P2 <1,?,3,4>
P3 <1,?,3,4> P4 <1,?,3,4>