Download presentation
Presentation is loading. Please wait.
Published byJean Atkins Modified over 8 years ago
1
Consensus with Partial Synchrony Kevin Schaffer Chapter 25 from “Distributed Algorithms” by Nancy A. Lynch
2
Consensus System inputs init(v) i stop i System outputs decide(v) i
3
Constraints Well-formedness: Interactions between U i and A are well-formed for i Agreement: All decision values are identical Validity: If all init actions specify the same value v, then v is the only possible decision value f-failure termination, 0 f n: If init occurs on all ports and stop occurs on at most f ports, then a decide occurs on all non-failing ports.
4
PSynchFD Failure Detector Each process continually sends messages to all other processes If P i performs m steps without receiving a message from P j, then it outputs inform-stopped(j) m must be strictly greater than (d + 2 )/ 1 + 1
5
Correctness of PSynchFD All failures are eventually detected by all other non-failed processes After performing (d + 2 )/ 1 + 1 steps, at least d + 2 time has passed; it takes at most d + 2 for a message sent from P j to reach P i ; hence, P j must have stopped Once a stop j occurs, it takes at most Ld + d + O(L 2 ) for either an inform-stopped(j) i or a stop i to occur
6
Transforming Synchronous to Partially Synchronous In A each process P i is the composition of two MMT automata: Q i and R i Q i is a PSynchFD process R i is simulates the synchronous algorithm Each R i keeps track of the current round r and moves to the next round once it has received all round r messages from all non-failed processes B is A with the input and output corrected
7
Process P in B
8
Upper Bound
9
Synchronous Algorithm Synchronous algorithm adapted to partially synchronous model Uses PSynchFD to detect process failures Complexity: T(0) + f(Ld + d) + d + O(fL 2 )
10
PSynchAgreement Uses PSynchFD to detect process failures Proceeds in rounds A process can decide 0 in even-numbered rounds and 1 in odd-numbered rounds Processes start round 0 after receiving input Each process has a variable decided to keep track of which processes have decided
11
PSA Algorithm Round 0 If input is 1 then Send goto(1) to all processes Go to round 1 If input is 0 then Send goto(2) to all processes Output decide(0) Send decided to all processes
12
PSA Algorithm (2) Round r > 0 If process received goto(r + 1) from anyone Send goto(r + 1) to all processes Go to round r + 1 If process received goto(r) from everyone not in stopped decided Send goto(r + 2) to all processes Output decide(r mod 2) Send decided to all processes
13
Lemma 25.7 If any process sends goto(r + 2), then some process tries to decide at round r If any process reaches round r + 2, then some process tries to decide at round r
14
Lemma 25.8 If a process i decides at round r then: R i sends no goto(r + 1) messages R i sends a goto(r + 2) message to every process No process tries to decide at round r + 1
15
Validity If all processes start with 0, then no process can over leave round 0. No process can decide 1 in round 0. If all processes start with 1, then no process tries to decide in round 0. Lemma 25.7 implies that no process reaches round 2.
16
Agreement Suppose that Ri decides at round r and no process decides at any earlier round By Lemma 25.8, no process tries to decide at round r + 1. By Lemma 25.7, no process can reach round r + 3 All processes must decide in r or r + 2, which result in the same output value
17
Liveness Suppose R i gets stuck at round r > 0 All non-stopped, non-decided processes must eventually reach r Since r > 0, each process must send goto(r) to R i and R i must eventually receive it Therefore R i ’s condition for deciding it satisfied; a contradiction
18
Wait-Free Termination A quiet round r is one in which some process never receives goto(r + 1) If no process tries to decide at round r, then round r + 1 is quiet If some process decides at round r, then r + 2 is quiet There must eventually be a quiet round, hence wait-free termination is guaranteed Complexity: Ld + (2f + 2)d + O(f 2 + L 2 )
19
Lower Bound Suppose that n f + 1 There is no n-process agreement algorithm for the partially synchronous model that guarantees f-failure termination, in which all nonfaulty processes always decide strictly before time Ld + (f – 1)d
20
Other Results Synchronous processes, asynchronous channels: agreement is not solvable with even 1 failure Asynchronous processes, synchronous channels: same Eventual time bounds: solvable, but only if n > 2f
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.