Sei sulla pagina 1di 17

Slides for Chapter 18:

Replication

From Coulouris, Dollimore, Kindberg and Blair


Distributed Systems:
Concepts and Design
Edition 5, Addison-Wesley 2012
Figure 18.1
A basic architectural model for the management of replicated data

Requests and
replies

RM
C FE RM

Clients Front ends Service

C FE Replica
RM managers

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.2
View-synchronous group communication

a (allowed). b (allowed).
p crashes p crashes
p p

q q

r r

view (p, q, r) view (q, r) view (p, q, r) view (q, r)

c (disallowed). d (disallowed).
p crashes p crashes
p p

q q

r r

view (q, r) view (p, q, r) view (q, r)


view (p, q, r)

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.3
The passive (primary-backup) model for fault tolerance

Primary

C FE RM
RM
Backup

C FE RM
Backup

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.4
Active replication

RM

C FE RM FE C

RM

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.5
Query and update operations in a gossip service

Service

RM

gossip
RM RM

Query, prev Val, new Update,prev Update id

FE FE

Query Val Update


Clients

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.6
Front ends propagate their timestamps whenever clients communicate directly

Service

RM

gossip
RM RM

Vector
FE FE
timestamps

Clients

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.7
A gossip replica manager, showing its main state components

Other replica managers


Replica Replica log
timestamp
Gossip
messages
Replica manager

Timestamp table

Replica timestamp Value timestamp


Stable
Update log Value
updates

Executed operation table

Updates
OperationID Update Prev
FE FE

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.8
Committed and tentative updates in Bayou

Committed Tentative

c0 c1 c2 cN t0 t1 t2 ti ti+1

Tentative update ti becomes the next committed update


and is inserted after the last committed update cN.

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.9
Transactions on replicated data

Client + front end Client + front end

T U

deposit(B,3);

getBalance(A)
B
Replica managers
Replica managers

A A A B B B

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.10
Available copies

Client + front end T U Client + front end

getBalance(B)
deposit(A,3);
getBalance(A)
deposit(B,3); Replica managers
B
Replica managers M

A A B B

X Y P N

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.11
Network partition

Client + front end Client + front end


Network U
withdraw(B, 4) T partition
deposit(B,3);

B
Replica managers

B B B

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Page 810
Giffords quorum concensus examples

Example 1 Example 2 Example 3


Latency Replica 1 75 75 75
(milliseconds) Replica 2 65 100 750
Replica 3 65 750 750
Voting Replica 1 1 2 1
configuration Replica 2 0 1 1
Replica 3 0 1 1
Quorum R 1 2 1
sizes W 1 3 3

Derived performance of file suite:


Read Latency 65 75 75
Blocking probability 0.01 0.0002 0.000001
Write Latency 75 100 750
Blocking probability 0.01 0.0101 0.03

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.12
Two network partitions

Transaction T Network partition

Replica managers

X V Y Z

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.13
Virtual partition

Virtual partition Network partition

Replica managers

X V Y Z

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.14
Two overlapping virtual partitions

Virtual partition V1 Virtual partition V2

Y X V Z

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012
Figure 18.15
Creating a virtual partition

Phase 1:
The initiator sends a Join request to each potential member. The argument
of Join is a proposed logical timestamp for the new virtual partition.
When a replica manager receives a Join request, it compares the proposed
logical timestamp with that of its current virtual partition.
If the proposed logical timestamp is greater it agrees to join and replies Yes;
If it is less, it refuses to join and replies No.

Phase 2:
If the initiator has received sufficient Yes replies to have read and write
quora, it may complete the creation of the new virtual partition by sending
a Confirmation message to the sites that agreed to join. The creation
timestamp and list of actual members are sent as arguments.
Replica managers receiving the Confirmation message join the new virtual
partition and record its creation timestamp and list of actual members.

Instructors Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5
Pearson Education 2012

Potrebbero piacerti anche