• Tidak ada hasil yang ditemukan

Chapter 7 Consistency And Replication (2)

N/A
N/A
Protected

Academic year: 2019

Membagikan "Chapter 7 Consistency And Replication (2)"

Copied!
23
0
0

Teks penuh

(1)

DISTRIBUTED SYSTEMS

Principles and Paradigms

Second Edition

ANDREW S. TANENBAUM

MAARTEN VAN STEEN

Chapter 7

(2)

Plan

Motivation

Consistency models

Data-centric consistency

Client-centric consistency

Replica management

(3)

Consistency Protocols

Describe algorithm for

achieving a given

consistency model

Data-centric

(4)

Continuous Consistency

Bounding deviations

so as to avoid

Numerical errors

E.g., that deviation of

replicas’ stock quote is

more than 1.00$

Staleness errors

E.g., that last stock

quote is more than 1

hour old

Order errors

(5)

Bounding Numerical Deviation

Assume

N servers,

S

1

… S

N

Single data item

x

A write,

W(x),

has a weight,

weight(W)

, that is the amount that

x

changes

E.g.,

x = 1; x := x * 3

<- weight is …

2

weight(w) > 0

We have a limit on numerical deviation for the value of

x

,

v

i

, at

server

S

i

W(x)

x1

x2

x3

origin(W)

W(x)

W(x)

L1

L2

L3

Log of writes

performed

i

δ

(6)

Bounding Numerical Deviation

Define

I.e., sum of writes executed by

S

i

originating from

S

j

Note,

T[i,i]

are all values submitted by

S

i

W(x)

x1

x2

x3

origin(W)

W(x)

W(x)

L1

L2

L3

Log of writes

performed

=

=

{

(

)

|

(

)

}

]

,

(7)

Bounding Numerical Deviation

Define

Goal

(8)

Bounding Numerical Deviation

Assume

S

i

also sends

TW[i,k]

to

S

k

S

k

maintains this as a view,

TW

k

[i,k]

, of what

S

i

has

seen from

k

If then

S

k

forwards writes

from its log,

L

k

S

k

waits to commit new writes until these are

commited at

S

i

Guarantees that deviation is bounded as

(9)
(10)

Bounding Staleness Deviations

Goal

Ensure that there are no

W(x)

older than

TO

i

that

S

i

has not seen

”Older than”?

Vector clocks?

If we know drift rate of clocks and communication

delay, we can synchronize within a bound

W(x)

x1

x2

x3

origin(W)

W(x)

W(x)

L1

L2

L3

(11)

Bounding Staleness Deviations

In any case

Keep a real-time vector clock

VT

k

[i]

= Local time of last write from

S

i

If

|VT

k

[i] – T(k)| > TO

i

pull updates from

S

i

W(x)

x1

x2

x3

origin(W)

W(x)

W(x)

L1

L2

L3

(12)

Bounding Ordering Deviations

Check size of local queue of tentative updates

Updates may not have been committed due to

ordering constraints

If too large, try to agree on ordering of updates

before proceeding…

Ensuring consistent ordering

W(x)

x1

x2

x3

origin(W)

W(x)

W(x)

L1

L2

L3

(13)

Ensuring Consistent Ordering

Make a specific process responsible for

specific data item

Primary-Based Protocols

Enable multiple processes to carry out

write operations

(14)

Remote-Write Protocols

(15)

Local-Write Protocols

(16)

Replicated-Write: Active Replication

Multicast updates to

all replicas

Need ordering of

multicast

May be inefficient

Combine

primary-based (”token-site”)

and replicated-write

(”symmetric”)protocols

Use

primary-based

Use

replicated-write

Largest inter-message

(17)

Replicated-Write: Quorum

Multicast W(x), read x

Has the write been committed?

Is the value read up-to-date?

Static process group

Basic idea

Write (version(x), value(x))

When writing new version, get more than half of the

processes to approve

When reading, get response with latest version from more

than half of the processes

Avoid write/write conflicts

Avoid write/read conflicts

(18)

Replicated-Write: Quorum

Process group of size

N

Define

write quorum

size,

N

W

At least

N

W

processes need to agree on value and

version for us to read

read quorum

size,

N

R

At least

N

R

processes need to agree on value and

version for us to read

To make sure to read latest version

N

W

+ N

R

> N

N

W

+ N

W

> N

At least half of the processes

will have latest version

At least one process

(19)

Quorum-Based Protocols

Figure 7-22. Three examples of the voting algorithm.

(a) A correct choice of read and write set. (b) A choice

that may lead to write-write conflicts. (c) A correct

(20)

Client-Centric Consistency

Each client keeps track of

Read set:

identifiers of the writes

that are relevant to the read

operations performed by the

client

Write set

: identifiers of writes

performed by the client

Monotonic-read consistency

Read performed

Client hands in

read set

to

server

Server may need to

communicate with other server

to become up-to-date

Server returns updated

read set

Write performed

(Nothing particular)

(21)

Client-Centric Consistency

Monotonic-write consistency

Write

Client hands in

write set

to server

Server may need to communicate with

other server to become up-to-date

Server returns updated

write set

Read-your-writes consistency

Read

Client hands in

write set

to server

Server may need to communicate with

other server to become up-to-date

Server returns updated

write set

Writes-follow-reads consistency

Client hands in

write set

and

read set

to

server

Server may need to communicate with

other server to become up-to-date with

read set

Add identifiers from the

read set

to the

write set

(22)

Client-Centric Consistency

Efficiency?

Bound size of writes and

reads by grouping operations

into

sessions

E.g., clear sets when a client

exits a specific application

Use a vector timestamp…

WVC

i

[j]: the timestamp of the

latest write operation from S

j

that

S

i

has processed

SVC

A

[j]: the timestamp of the

latest write operation in the

session that originates from S

j

(23)

Summary

Various protocols for ensuring consistency

Data-centric consistency

Primary-based protocols

Replicated-write

Primary-based protocols most widely used due

to simplicity

Exact selection of protocol type depends on rate at

which request are processed and on message delay

Client-centric consistency may be efficiently

Referensi

Dokumen terkait

[r]

muat, yakni dalam keadaan normal dengan kecepatan 6 knot dan jumlah kuli 10 orang. Penilaian dilakukan terhadap perusahaan pelra dengan metode normalisasi data

Analisis STP digunakan untuk mengetahui siapa yang akan dijadikan target pemasang iklan setelah dilakukan pengelompokan pasar (segmentasi). Metode STP digunakan untuk

Dari hasil observasi, wawancara, dan hasil belajar IPA, dapat disimpulkan bahwa implementasi model pembelajaran project base learning (PjBL) membuat mainan berbasis gerak &amp;

Konsep dasar dalam sistem pengendalian manajemen yaitu membuat sebuah organisasi untuk mencapai sasaran yang diinginkan dalam hal ini tujuan yang ingin dicapai organisasi

Tujuan dari penelitian ini adalah untuk mengetahui, menguji dan membuktikan secara empiris pengaruh profitabilitas dan dividen terhadap Return saham pada

Berdasarkan tabel 4.10 dapat dilihat pada tabel Independent Samples T-Test bahwa nilai signifikansi pada kolom T-Test For Equality Of Means diperoleh nilai signifikan

Berdasarkan hasil penelitian pengetahuan dan sikap dengan penerapan keselamatan kerja di laboratorium Rumah Sakit Roemani Muhammadiyah Semarang maka dapat disimpulkan