Docsity

Consistency and Replication - Lecture Notes | ECE 6800, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Consistency and Replication - Lecture Notes | ECE 6800 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Consistency and Replication

Chapter 7

Andrew S. Tanenbaum, Distributed Systems: Principles and Paradigm,

Prentice Hall; 1st edition, 2002. ISBN: 0130888931

Chap. 7:

C

i

d R

li

i

Consistency and Replication

7.1 INTRODUCTION

7.1.1 Reasons for Replication

7.4 REPLICA MANAGEMENT

7.4.1 Replica-Server Placement

p

7.1.2 Replication as Scaling Technique

7.2 DATA-CENTRIC CONSISTENCY MODELS

(Old AST Text)7.2.1 Strict Consistency

p

7.4.2 Content Replication and Placement7.4.3 Content Distribution

7.5 CONSISTENCY PROTOCOLS

7.5.1 Continuous Consistency

7.2.2 Linearizability and Sequential Consistency7.2.3 Causal Consistency7.2.4 FIFO Consistency7.2.5 Weak Consistency7 2 6 Release Consistency

7.5.2 Primary-Based Protocols7.5.3 Replicated-Write Protocols7.5.4 Cache-Coherence Protocols7.5.5 Implementing Client-Centric Consistency

7 6 SUMMARY

7.2.6 Release Consistency7.2.7 Entry Consistency7.2.8 Summary of Consistency Models

7.3 CLIENT-CENTRIC CONSISTENCY MODELS

7.3.1 Eventual Consistency

7.6 SUMMARY

y

7.3.2 Monotonic Reads7.3.3 Monotonic Writes7.3.4 Read Your Writes7.3.5 Writes Follow Reads

How Consistency is Implemented

Issues:

  • Distribution of updates, which includes placements of

updates and how updates are propagatedHow replicas are kept consistent

  • How replicas are kept consistent
    • Strong consistency – propagate updates immediately• Lesser consistency – caching protocols• In general, protocols with implementations are important.

Reasons for Replication

(1) Enhance Reliability

–^

Continue operations when one replica is overloaded or crashes

-^

Protection from data corruptions by multiple source comparison

-^

Write errors

-^

Intentional or unintentional corruption of data (virus or bugs)

(2) Improve Performance.

–^

Provide a means for scaling upG

hi

l di t ib ti

f

–^

Geographical distribution of servers

-^

DNS
–^

Previous topics: super-servers, concurrent servers, object adapters

The down side

–^

Replica consistencyNetwork bandwidth for replication and consistency

-^

Network bandwidth for replication and consistency

-^

Naming and location service requirements

Synchronizing all Replicas

Updating as an atomic operation or transactionWhen is updating to be performed

p

g

p

–^

Global ordering

-^

Lamport timestamps, centralized coordinator, and other approachesIs the solution worse than the original problem?

-^

Is the solution worse than the original problem?

Reduced consistency constraints

–^

Can help to avoid global synchronization

-^

But copies may not always be identical (web page caches and updating)

-^

Loosening of constraints are based on the access and update patterns ofthe data/object.

j

-^

Based on the type of data being used

-^

Based on the purpose for which the data will to be used

Data-Centric Consistency Models

The general organization of a logical data store, physically

distributed and replicated across multiple processes.

p

p

p

Continuous Consistency

Three independent axis for defining inconsistencies•^

Deviation in numerical values between replicas

-^

Deviation in staleness between replicas

-^

Deviation with respect to ordering of update operations

R f

d t

f^

i^

ti

i t

Referred to as forming continuous consistency ranges.Conit

–^

A unit over which consistency is to be measured

y

–^

Examples follow

-^

Granularity: large measures or small measures

-^

False sharing of conit? Are they independent by counted together

-^

False sharing of conit? Are they independent by counted together.

Continuous Consistency (1)

Figure 7-2. An example of keeping track of consistency

Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-

Hall, Inc. All rights reserved. 0-13-239227-

g^

p^

p^

g^

y

deviations [adapted from (Yu and Vahdat, 2002)], p. 279.

Continuous Consistency (3)

Figure 7-3. Choosing the appropriate granularity for a conit.

(b) No update propagation is needed (yet)

Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007

(b) No update propagation is needed (yet).Prentice-Hall, Inc. All rights reserved. 0-13-239227-

Consistent Ordering Operations

The previous textbook described a range of “data-centric

consistency models” that are useful to review tounderstand the definitions and contemplate different“l

l ”

f^

i

“levels” of consistency.

The current text only describes:

S

i l C

i

  • Sequential Consistency– Causal consistency

“Synchronization Variables”

Synchronization Variables

Consistency Definitions (1)

Strict Consistency

  • Any read on a data item x returns a value corresponding to the result of

the most recent write.

Linearizable Consistency

  • The result of any execution is the same as if the (read and write)

The result of any execution is the same as if the (read and write)operations by all processes on the data stores were executed in somesequential order AND the operations of each individual process appear inthis sequence in the order specified by the program. In addition, if

q^

p^

y^

p^

g^

ts[OP1(X)] < ts[OP2(y)], then operation OP1(x) should precededoperation OP2(y) in this sequence.

Sequential ConsistencySequential Consistency

  • The result of any execution is the same as if the (read and write)

operations by all processes on the data stores were executed in somesequential order AND the operations of each individual process appear in sequential order AND the operations of each individual process appear inthis sequence in the order specified by its program.

Strict Consistency

Any read on a data item x returns a value correspondingto the result of the most recent write.^ Behavior of two processes, operating on the same data item.

p

,^

p

g

-^

A strictly consistent store.

-^

A store that is not strictly consistent.

Linearizability and Sequential Consistency (2)

Linearizable Consistency

The result of any execution is the same as if the (read and write) operations by allprocesses on the data stores were executed in some sequential order AND theprocesses on the data stores were executed in some sequential order AND theoperations of each individual process appear in this sequence in the order specifiedby the program. In addition, if ts[OP1(X)] < ts[OP2(y)], then operation OP1(x)should preceded operation OP2(y) in this sequence.

Process P

Process P

Process P

x = 1; print ( y, z);

y = 1; print (x, z);

z = 1; print (x, y);

Three concurrently executing processes.

Linearizability and Sequential Consistency (3)

x = 1;print ((y, z);

x = 1;y = 1;

y = 1;z = 1;

y = 1;x = 1;

y = 1;print (x, z);z = 1;

print (x,z);print(y, z);z = 1;

print (x, y);print (x, z);x = 1;

z = 1;print (x, z);print (y, z);

print (x, y);Prints: 001011

print (x, y);Prints: 101011

print (y, z);Prints: 010111

p^

(y

)

print (x, y);Prints: 111111

Signature:

001011

Signature:

101011

Signature:

110101

Signature:

111111

Four valid execution sequences for the processes of the previous

(a)

(b)

(c)

(d)

slide. The vertical axis is time.

Signature

Æ

print statements of {P1, P2, P3}