240 likes | 259 Views
Understand the significance of N-consensus in distributed systems, implications for emulation, connectivity, and protocol execution. Explore inseparability, theorems, and practical applications.
E N D
N-Consensus is the Second Strongest Object for N+1 Processes Petr Kuznetsov Max Planck Institute for Software Systems Eli Gafni UCLA
Distributed shared memory • Processes communicate via objects • Each object is an instance of a type • Type N-consensus: first N operations propose(v), v∈{0,1} return the argument of the first operation, N+1-th fails • Object types can be classified by their consensus power
Consensus power • Cons(T)=N iff objects of T and RW registers can implement N-consensus but not N+1-consensus • N-consensus is universal in a system of N processes : can implement an object of any type [Her91]
What about N or more processes? Can objects of consensus power N “do more” than N-consensus objects? No: if an N+1-process task can be solved by deterministic objects of consensus power N, then it can also be solved by N-consensus objects ⇨ There are no objects between N- and N+1-consensus
Main results Theorem 1. Any protocol over N+1 processes using deterministic objects of consensus power N is connected. Theorem 2. Any connected protocol over N+1 processes can be emulated using N-consensus
The rest of it • Definitions and tools • Inseparability • Theorem 1: connectivity of protocols • Theorem 2: emulation • Conclusions and future
Processes and protocols • N+1 processes communicate via objects of consensus power N, RW registers • Protocol P: a collection of deterministic automata P1,…PN+1, assume a single initial state
Objects and synchrony • Objects are atomic and deterministic: an execution of P can be seen as a sequence of process ids • a state of P is a finite execution • a view of Pi in x is the local state of Pi in x • System is asynchronous: we consider all possible executions • 2-consensus cannot be implemented using RW registers • N+1-consensus cannot be implemented using N-consensus
Some tools • 2-process ε-agreement task for q0 and q1 • If qi goes alone, qi outputs i • outputs are within ε in [0,1] (can be implemented using RW registers) • N-consensus can be used to split processes in two teams, each running as a single process in a 2-process RW protocol (e.g., ε-agreement)
Inseparability States x0 and x1 of P are inseparable (x0~x1) iff some process Picannot distinguish x0 and x1 even in an infinite execution x0 x1 Pi goes through the same sequence of views in e0 and e1 e0 e1
Inseparably connected protocols P is inseparably connected iff for each state x of P, the set G(x) of N+1 immediate descendants of x is transitively inseparable x … x1 x2 xN xN+1 ~ … ~ ~ ~ There is a path of inseparable states between any two states in G(x)
Connectivity and consensus power Theorem 1. Any protocol over N+1 processes using deterministic objects of consensus power N is connected Proof sketch: • suppose some G(x) is ~ disconnected • each execution extending x reveals the component of G(x) • we can solve consensus using x and P (use determinism here)
Emulation of connected protocols • Let P be connected • Then we can emulate it using N-consensus! Emulation: • Processes periodically output views of P • Safety: All output views are compatible with an execution of P • Liveness: at least one active process makes progress (outputs infinitely many views of P)
Emulation invariants • Each process maintains a local estimate of the “current” state of P • Asynchronous phases, at the end of each phase: • There are at most two different state estimates, and they are inseparable • At least one participant outputs a new view • All views output so far are compatible with both state estimates
Phase description • Processes split in two teams q0 and q1 • Each qi elects a member to promote: proposes a new “next” state xi and a new view vi • q0 and q1 runs ε-agreement and map the results to vertices of the non-separating path connecting x0 and x1
Look in the future: x0~x1 Go along inseparable executions until a confusing view v
Look in the future: x0 and x1 are not inseparable But their parents x0’ and x1’ are – concatenate the paths
Choosing the next state: safety • ε=Ω(1/N): the decided vertices are neighbors • Neighboring states are inseparable • Each view is compatible with neighboring states: safety is guaranteed!
Joining a team: liveness In every phase, a process: • Try to agree on the system state using N-consensus • If succeeded, join team q0 • If failed (only if N came earlier)– join q1 • ≤N processes participate⇨ q1 is empty • Only a participant obtains a new view: liveness is guaranteed!
A corollary that matters Let P be any protocol that solves a task M A non-blocking emulation of P is also wait-free: every active process makes progress Every N+1-process task that can be solved by objects of consensus power N can also be solved by N-consensus objects
Summary • Inseparability (a general connectivity) • Emulation of any connected protocol • In a system of N+1 processes, there is no object between N- and N+1-consensus
Related questions • Can objects of consensus power N be implemented by N-consensus objects? • Common2 class: is queue in it? [Afek et al. 93,…] • How to emulate a protocol P that uses objects of two types, each of consensus power N • Robustness [Jay93,…] • Non-determinism?
Deterministic objects • Q, set of states • O, set of operations • R, set of responses • σ, Q x O → Q x R, sequential specification RW-register: a read returns the most recent written value N-consensus: first N agree on a proposed value, N+1-th fails