shameless statements about replication rachid guerraoui school of computer and communication...

58
Shameless Statements Shameless Statements about Replication about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Upload: halle-blois

Post on 01-Apr-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements Shameless Statements about Replicationabout Replication

Rachid Guerraoui

School of Computer and Communication Sciences, EPFL

Joint ruminations with Eli Gafni (UCLA-MSR)

Page 2: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 2

Replication is all over the Replication is all over the placeplace

• Replicated databasesReplicated databases

• Reliable middleware

• Storage systems

• Non-blocking data structures

• Group communication

Page 3: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 3

Highlight the important principles

(results/algorithms)

Deconstructing Deconstructing replicationreplication

Page 4: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 4

A perspective on replicationA perspective on replication

Page 5: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 5

“Here are my principles. If you don’t like them, I have

others”

Groucho Marx

A grain of saltA grain of salt

Page 6: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 6

Deconstructing Deconstructing replicationreplication

• For now, let’s For now, let’s • (1) ignore performance and focus on • (2) strong and general replication of

• (3) an object shared by 2 processes

Page 7: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 7

ReplicationReplication

P1P1

P2P2

OOOO

opAopA opAopA

opBopBopBopB

Page 8: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 8

The players

Page 9: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 9

The scheduler decides which process goes next

The processes take steps

The game

Page 10: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 10

ReplicationReplication

P1P1

P2P2

OO

O’O’

opAopA opBopB

Fair agreement on the order Fair agreement on the order

opAopA

opBopBopAopAopBopB

Page 11: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 11

ReplicationReplication

P1P1

P2P2

OO

O’O’

opAopA

opBopB

ConsensusConsensusSharedShared

memorymemory

opBopBopAopA

opBopBopAopA

Page 12: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 12

StatementStatement

• (1) Behind every (1) Behind every replicationreplication lie a lie a

consensusconsensus and a and a shared memoryshared memory

ConsensusConsensus

Page 13: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 13

Consensus is impossible: FLPConsensus is impossible: FLP

Asynchronous shared Asynchronous shared

memory systemmemory system

p1p1 p2p2

Page 14: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 14

Synchronous consensus is possibleSynchronous consensus is possible

Synchronous systemSynchronous system

Asynchronous systemAsynchronous system

Page 15: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 15

<>Synchronous consensus is <>Synchronous consensus is possiblepossible

<>Synchronous system<>Synchronous system

Asynchronous systemAsynchronous system

Page 16: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 16

Consensus is almost possibleConsensus is almost possible

-synchronous system-synchronous system

Page 17: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 17

“One person is missing and the whole world seems depopulated”

Alphonse de la Martine

Consensus is possible iff Consensus is possible iff -synchrony-synchronyp1p1 p2p2

Page 18: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 18

Bottom lineBottom line

• (1) Behind every (1) Behind every replicationreplication lie a lie a

consensusconsensus and a and a shared memoryshared memory

• (2) Behind every consensus lies some -synchrony

-synchrony-synchrony

Page 19: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 19

Consensus is almost possible

Page 20: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 20

Consensus (primary)Consensus (primary)

P1P1

P2P2

V1V1

V2V2

V1V1

SharedShared

memorymemory

V1V1

Page 21: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 21

Consensus (primary)Consensus (primary)

P1P1

P2P2

V1V1

V2V2

SharedShared

memorymemory

V1V1crashcrash

Page 22: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 22

Consensus (primary-backup)Consensus (primary-backup)

P1P1

P2P2

V1V1

V2V2V1V1

SharedShared

memorymemory

V1V1 V1V1

Page 23: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 23

Consensus (primary-backup)Consensus (primary-backup)

P1P1

P2P2

V1V1

V2V2

V2V2

SharedShared

memorymemory

crashcrashV1V1

Page 24: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 24

Consensus (primary-backup)Consensus (primary-backup)

P1P1

P2P2

V1V1

V2V2V2V2

SharedShared

memorymemory

V1V1 V1V1

V2V2

Page 25: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 25

Consensus (2PC)Consensus (2PC)

P1P1

P2P2

V1V1

V2V2

Shared memoryShared memory

V1V1

V1V1

V1V1 commitcommit

Page 26: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 26

Consensus (2PC)Consensus (2PC)

P1P1

P2P2

V1V1

V2V2

Shared memoryShared memory

V2V2

V2V2V2V2commitcommit

Page 27: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 27

Consensus (2PC)Consensus (2PC)

P1P1

P2P2

V1V1

V2V2

Shared memoryShared memory

V1V1

V2V2

abortabort

abortabort

Page 28: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 28

Towards indulgent consensusTowards indulgent consensus

Asynchronous systemAsynchronous system

• Indulgence: tolerates arbitrarily long periods of asynchrony, i.e., tolerates any prefix

Page 29: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 29

Indulgence

Page 30: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 30

« He that is without sin among you, let him cast the first stone at her  » John 8:3-11

Indulgence

Page 31: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 31

Indulgence

Always preserves safety

Ensures liveness whenever possible

« While there is life there is hope » Cicero

Page 32: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 32

Indulgent consensus Indulgent consensus (3PC)(3PC)

P1P1

P2P2

V1V1

V2V2

commit/abortcommit/abort commit/abortcommit/abort

Page 33: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 33

• The processes dynamically exclude one suffix of a run, using a system oracle:

Indulgent consensus Indulgent consensus (3PC)(3PC)

A failure detectorA failure detector

Page 34: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 34

Weakest failure detector

• The weakest failure detector for consensus -

• The weakest failure detector question translates into the smallest suffix set to be excluded

Page 35: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 35

Weakest failure detectorWeakest failure detector

p1p1 p2p2

Page 36: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 36

Shared memory assumptionShared memory assumption

Helps better understand consensus Helps better understand consensus results (FLP, FD, 2PC, 3PC)results (FLP, FD, 2PC, 3PC)

Needed anyway for replication (and indulgent consensus)

Page 37: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 37

Bottom lineBottom line

• (1) Behind every (1) Behind every replicationreplication lie a lie a

consensusconsensus and a and a shared memoryshared memory

• (2) Behind every consensus lies some -synchrony

shared memoryshared memory

Page 38: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 38

ABD (Snapshot)ABD (Snapshot)

P1P1

P2P2

V1V1

V2V2

QuorumQuorum

writewrite

readread

Page 39: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 39

The many faces of quorumsThe many faces of quorums

Byzantine quorums

Failure detector quorums

Refined quorums

Probabilistic quorums

Page 40: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 40

Bottom lineBottom line

• (1) Behind every (1) Behind every replicationreplication lie a lie a

consensusconsensus and a and a shared memoryshared memory

• (2) Behind every consensus lies some -synchrony

• (3) Behind every shared memory lies a quorum

Page 41: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 41

Deconstructing Deconstructing replicationreplication

• (1) ignoring performance And focusing on• (2) strong and general replication of• (3) one object shared by 2 processes

Page 42: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 42

The engineerThe engineer

In real systems, we do care about In real systems, we do care about performanceperformance and we are happy with and we are happy with weak replicationweak replication

Much ado about nothing?

Page 43: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 43

What about performance?What about performance?

Let’s move now to a message passing system with communication delays/rounds

Page 44: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 44

What about performance?What about performance?

Synchronous system with few failuresSynchronous system with few failures

Asynchronous systemAsynchronous system

Plan for the worst and hope for the bestPlan for the worst and hope for the best

Page 45: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 45

What about performance?What about performance?

How many synchronous rounds does consensus How many synchronous rounds does consensus need? need?

A shared memory system of n processes with 1 failure can simulate x rounds of a synchronous system with x failures

At least t+1

Page 46: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 46

The inherent price of The inherent price of indulgenceindulgence

• How many synchronous rounds does an indulgent consensus need to decide with f failures?

A shared memory system of n processes with 1 failure can simulate x+1 synchronous rounds of an indulgent consensus algorithm with x failures

At least f+2

Page 47: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 47

The inherent price of The inherent price of indulgenceindulgence

• For how long does a system need to be synchronous for indulgent consensus to terminate?

No clue…

Page 48: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 48

The inherent price of The inherent price of indulgenceindulgence

• How many servers need to be correct in order for indulgent consensus to decide in x synchronous rounds?

Refined quorums

Page 49: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 49

More about performance…More about performance…

•Disk accesses?

•Throughput?

Page 50: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 50

What about weak replication? What about weak replication?

Is consensus necessary for weak replication?Is consensus necessary for weak replication?

If replicas would never need to agree on any state, they would not be called replicas

Page 51: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 51

What is weak replication? What is weak replication?

The answer, my friend, is blowin' in the wind

Page 52: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 52

What about weak replication? What about weak replication?

Does ad-hoc replication need consensus?

We need consensus among 2 processes

Say we know the semantics of an object, e.g., a queue? (weaker than consensus)

Page 53: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 53

What about weak replication? What about weak replication?

• Does eventual replication need consensus?

• It does eventually..

• Does probabilistic replication need consensus?

• It does need randomized consensus..

Page 54: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 54

What if What if

• We give up safety and let some of the replicas disagree?

• We might need set-agreement

• We give up liveness and ensure termination only if k processes are concurrent?

• We might need set-agreement

Page 55: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 55

The future of replication

• What form of quorum (shared memory) does a set-agreement actually need?

• For how long does a system need to be synchronous for indulgent set-agreement to terminate?

Page 56: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 56

The one slide to rememberThe one slide to remember

• (1) Behind every (1) Behind every replicationreplication lie lie

agreementagreement and and shared memoryshared memory

• (2) Behind every agreement lies -synchrony

• (3) Behind every shared memory lies a quorum

Page 57: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 57

Or at least this oneOr at least this one

Page 58: Shameless Statements about Replication Rachid Guerraoui School of Computer and Communication Sciences, EPFL Joint ruminations with Eli Gafni (UCLA-MSR)

Shameless Statements about Replication Slide 58

What about more processes?What about more processes?

f-process wait-free systemf-process wait-free system

n-process (f-1)-resilient systemn-process (f-1)-resilient system