Reduction Revisited: Verifying Round-Based Distributed Algorithms
Stephan Merz
INRIA Nancy & LORIA joint work with Bernadette Charron-Bost, LIX & CNRS
MPC 2010 June 23, 2010
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 1 / 39
Reduction Revisited: Verifying Round-Based Distributed Algorithms - - PowerPoint PPT Presentation
Reduction Revisited: Verifying Round-Based Distributed Algorithms Stephan Merz INRIA Nancy & LORIA joint work with Bernadette Charron-Bost, LIX & CNRS MPC 2010 June 23, 2010 Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 1
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 1 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 2 / 39
1
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 2 / 39
1
2
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 2 / 39
1
2
3
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 2 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 3 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 4 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 4 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 4 / 39
◮ right commutes with every action of different processes ◮ example: acquisitions of resources (e.g., semaphores)
◮ left commutes with every action of different processes ◮ example: releases of resources
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 5 / 39
◮ in particular, cannot make await condition of other process true ◮ formally, s
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 6 / 39
◮ in particular, cannot make await condition of other process true ◮ formally, s
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 6 / 39
◮ in particular, cannot make await condition of other process true ◮ formally, s
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 6 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 7 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 8 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 9 / 39
◮ first reduction theorem for total correctness ◮ needs commutativity hypotheses for actions outside reduced block
◮ generalization of Doeppner’s theorem ◮ preservation of invariants Q of Π by reduction
◮ reformulation of Lamport & Schneider in TLA ◮ extension to (certain) liveness properties Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 10 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 11 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 12 / 39
◮ each node proposes a value initially ◮ eventually nodes decide a common value ◮ nodes or communication links may fail
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 13 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 14 / 39
◮ introduce timeouts: being late is a failure ◮ assume reliable (broadcast) communication ◮ augment system by an oracle to detect failures
◮ difficult proofs . . . often absent or informal ◮ DiskPaxos: careful paper proof (30 pages for 0.5 page algorithm)
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 14 / 39
◮ uniform treatment of all (benign) errors ◮ do not identify “culprit” or “type” of failure Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 15 / 39
◮ uniform treatment of all (benign) errors ◮ do not identify “culprit” or “type” of failure
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 15 / 39
◮ uniform treatment of all (benign) errors ◮ do not identify “culprit” or “type” of failure
◮ rounds: local structure of process computation ◮ state s′ computed from s and received messages ◮ heard-of set HO(p, r): processes from which messages are received ◮ communication-closed rounds: discard late messages Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 15 / 39
◮ process states: sets Statep with initial states s0,p ∈ Statep ◮ message sending and state transition
◮ domain of second argument of Tr
◮ algorithm behavior determined by collection of heard-of sets ◮ extension to non-deterministic processes straightforward Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 16 / 39
◮ safety: restrict number or extent of errors ◮ liveness: assume eventual functioning of components
◮ standard failure assumptions can be expressed in terms of HO sets Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 17 / 39
p : send xp to all processes
p : if |HO(p, r)| > 2N/3 then
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 18 / 39
◮ message receptions, local transitions, message sending ◮ verify correctness for all HO collections
p(st, q)) enddo;
p(st, rcvd), r + 1;
p(st, q)) enddo;
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 19 / 39
◮ message receptions, local transitions, message sending ◮ verify correctness for all HO collections
p(st, q)) enddo;
p(st, rcvd), r + 1;
p(st, q)) enddo;
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 19 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 20 / 39
◮ send actions are left movers ◮ receive actions are right movers
Reduction Revisited MPC 2010 21 / 39
◮ send actions are left movers ◮ receive actions are right movers
p(st, q)) enddo;
p(st, rcvd), r + 1;
p(st, q)) enddo;
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 21 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 22 / 39
◮ round rndm
◮ messages sent during rndn
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 22 / 39
◮ round rndm
◮ messages sent during rndn
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 22 / 39
◮ all processes simultaneously perform transition for same round ◮ corresponds to “nice” executions in the fine-grained model
◮ σ0(p) = s0,p ◮ σr+1(p) = Tr
◮ no need for explicit representation of network ◮ no round numbers: “synchronized” processes Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 23 / 39
◮ all processes simultaneously perform transition for same round ◮ corresponds to “nice” executions in the fine-grained model
◮ σ0(p) = s0,p ◮ σr+1(p) = Tr
◮ no need for explicit representation of network ◮ no round numbers: “synchronized” processes
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 23 / 39
◮ p-view of fine-grained execution ξ = c0c1 . . .
◮ p-view of coarse-grained execution σ = σ0σ1 . . .
◮ p-views are sequences of states of p and can be compared
◮ local views equal up to stuttering, for every process Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 24 / 39
r .st(p)])r∈N
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 25 / 39
◮ many properties depend only on local views ◮ these can be verified by considering only coarse-grained executions
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 26 / 39
◮ many properties depend only on local views ◮ these can be verified by considering only coarse-grained executions
◮ formulas Q(p) built solely from p’s state variables ◮ arbitrary first-order combinations of local properties ◮ but: temporal combinations need not be local, consider:
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 26 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 27 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 28 / 39
◮ model coarse-grained executions for fixed number of processes ◮ non-deterministic choice of HO sets at every transition ◮ resulting model is finite-state
◮ high-level definition of coarse-grained HO semantics ◮ pre-define useful communication predicates ◮ concrete algorithms obtained later as instances
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 29 / 39
△
△
△
△
△
△
△
△
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 30 / 39
◮ expressiveness of TLA+ leads to perspicuous formulation ◮ (auxiliary) variable heardof records HO sets during a run ◮ mainly used for debugging and printing counter-examples
◮ safety predicates: add to next-state relation ◮ liveness predicates: natural expression in temporal logic ◮ used to express correctness properties Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 31 / 39
△
△
△
△
△
△
△
△
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 32 / 39
△
△
△
△
△
△
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 33 / 39
△
△
△
△
△
△
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 34 / 39
◮ high branching factor: exploration of all HO collections ◮ many redundant states generated
◮ more complicated encodings necessary for tools like NuSMV ◮ cf. work by Tsuchiya and Schiper: Paxos for 10 processes Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 35 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 36 / 39
1
2
3
4
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 37 / 39
1
2
3
4
◮ 8 pages for generic module and lemmas ◮ 8 pages for OneThirdRule ◮ 25 pages for LastVoting
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 37 / 39
Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 38 / 39
◮ identify left and right movers for coarser unit of atomicity ◮ distributed algorithms present interesting opportunities ◮ substantial reduction of verification effort possible
◮ beyond programming-language based presentations ◮ wide interpretation of “processes” (e.g., set of rounds) ◮ verify safety and liveness properties
◮ establish more general reduction theorems ◮ better syntactic characterization of local properties ◮ implementation of reduction in verification tools Stephan Merz (INRIA Nancy) Reduction Revisited MPC 2010 39 / 39