wait-free consensus with infinite arrivals james aspnes gauri shah jatin shah yale university stoc...

21
Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Post on 15-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Wait-Free Consensus with Infinite Arrivals

James AspnesGauri ShahJatin Shah

Yale UniversitySTOC 2002

Page 2: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Consensus (1)

Get collection of processes to agree on a value s.t.

Consensus Protocol

Agreement: all processes give same output.

Page 3: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Consensus (2)

Consensus Protocol

Validity: if inputs agree, output=input.

Wait-Free Termination: finite work done by any process

Page 4: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Why do we care about consensus?

Universal Construction (Herlihy 1991)

Wait-free implementation of any linearizableshared object using consensus

n-processor

Consensus Object Linearized operations

Page 5: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Impossibility of Consensus*

*Deterministic, asynchronous, with 1 failure:

•Message-passing model (Fischer, Lynch, Paterson ’85)•Shared-memory model (Loui, Abu-Amara ’87)

Algorithms for randomized consensus:

Ben-Or (1983) and many others

Possible using: Randomization

Page 6: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

So far...

Consensus with n processes is possible using randomization

What happens if we don’t know n?

What if we have infinitely many processes?

Page 7: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Infinite Arrivals Model(Gafni, Merritt, Taubenfeld 2001)

Concurrency

birth death

alive

Countably infinite collection of processes Communicate using atomic shared R/W registers

R/W registers

asleep

Page 8: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Infinite Arrivals Model

RW----R---R---W---W

R---R---R---W

R----R

Concurrency: number of processes alive at any time•Unbounded, Bounded, b-Bounded

Adversary controls scheduling of processes.

Page 9: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Algorithms for the model

Snapshot like collect, but all registers read simultaneously.

Collect•updatei(d): write d to register i.

•scani:equivalent to reading all nonempty

registers one at a time.

Page 10: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

A Randomized Binary Consensus Protocol

(Based on Chandra 1996)

Slow processesadopt leader’spreference:

Race between processeswith and :

No agreementof leaders: flip global coin

c

Page 11: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Shared CoinProcesses toss own coins and take majority of all values.

Strong adversary can selectively kill processes about to write votes for values he does not like.

0 0

1 00

10

0

1

Votes Cast

0

1

0

0

1

Page 12: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Voting with n processesStrong adversary can shift total by n-1 votesby killing processes carrying selected votes.

Then take majority of votes to get constant probability of unbiased outcome.

2n

-(n-1) 0 (n-1)

Sum of votes

Pro

babili

ty

Processes repeatedly vote to get total of votes

Page 13: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

But with infinitely many processes...

Adversary can hide infinitely many votes!

Sum of votes

Adversary can shift the majority to get any outcome desired.

0

Pro

babili

ty

Page 14: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Convergent Voting

Let vote of process i beweighted by ith term of convergent seriesV

ote

of

i

i

Adversary can shift majority only by constant amount!

Gives shared coin Binary Consensus

With few additions: Expected work of process i:

(T: Number of operations for one collect)

)ε1iO(T

ε11/i i

Page 15: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

So we have…

Consensus for infinitely many processes with:•Binary input values•Process identities

What about:•Arbitrarily many input values?•No identities?

Page 16: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Infinitary Consensus(Based on adaptive mutual exclusion of Attiya, Bortnikov

2000)

Time taken by process with value k = O(T log k)

[T = time for single execution of binary consensus protocol]

1

2 3

74 5 6

8 9 10 11 12 13 14 15

Binary Consensus Protocol

Page 17: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Naming: Lazy Clock(with b-bounded concurrency)

Issue identities to anonymous processes.Then use regular shared coin.

Returns < duplicates of c.2b

Choose ID from large range to separate duplicates.

b registers

12 19 2 21 28 23

c := max of all b registers + 1

max=28c=29

reg[c mod b] := c

29

Page 18: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Weak adversary(b-bounded concurrency)

Shared coin: Write local coin tosses to registers and take majority vote.

Each (anonymous) process takes: O(b log b) time.

b log 2b registers

0

b log 2b registers

Adversary can select votes but can’t see them.

0 0

Page 19: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Summary of Results(for strong adversary)

Concurrency Anonymity Operations for process

Unbounded No

Bounded NoYes Unbounded

b-bounded, b>1

NoYes Unbounded

1-bounded Yes

) iO(T ε1

O(1)

) iO(T ε1

thi

*Corresponding lower bound existsT = number of operations for one collect

) iO(T ε1

*

Page 20: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

Summary of Results(for weak adversary)

Concurrency

Anonymity

Operations per process

Bounded Yes O(b log b)

b-bounded, b>1

Yes O(b log b)

Page 21: Wait-Free Consensus with Infinite Arrivals James Aspnes Gauri Shah Jatin Shah Yale University STOC 2002

The big open question

Is it possible to do consensus with

Unbounded Concurrency and

Anonymity?Cannot build shared coin for above conditions with strong adversary!

Design a protocol without a shared coin?