6.4 Data and File Replication Gang Shen. Why replicate Performance Reliability Resource sharing ...

23
6.4 Data and File Replication Gang Shen

Transcript of 6.4 Data and File Replication Gang Shen. Why replicate Performance Reliability Resource sharing ...

Page 1: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

6.4 Data and File Replication

Gang Shen

Page 2: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Why replicate

PerformanceReliabilityResource sharingNetwork resource saving

Page 3: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Challenge

Transparency Replication Concurrent control Failure recovery Serialization

Page 4: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Atomicity

In database systems, atomicity is one of the ACID transaction properties. An atomic transaction is a series of database operations which either all occur, or all do not occur[1].

All or nothing

Page 5: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Atomicity

In DFS (Distributed File System), replicated objects (data or file) should follow atomicity rules, i.e., all copies should be updated (synchronously or asynchronously) or none.

Page 6: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Goal

One-copy serializability: The effect of transactions performed by clients on replicated objects should be the same as if they had been performed one at a time on a single set of objects.[2]

Page 7: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Architecture

FSA , File service agent, client interface RM, replica manager, provide replication

functions [3]

Page 8: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Architecture[3]

RM

RM

RM

RM

FSA

FSA

Client

Client

Page 9: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Read operations [3]

Read-one-primary, FSA only read from a primary RM, consistency

Read-one, FSA may read from any RM, concurrency

Read-quorum, FSA must read from a quorum of RMs to decide the currency of data

Page 10: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Write Operations[3]

Write-one-primary, only write to primary RM, primary RM update all other RMs

Write-all, update to all RMs Write-all- available, write to all functioning

RMs. Faulty RM need to be synched before bring online.

Page 11: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Write Operations

Write-quorum, update to a predefined quorum of RMs

Write-gossip, update to any RM and lazily propagated to other RMs

Page 12: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Read one primary, write one primary

Other RMs are backups of primary RM No concurrency Easy serialized Simple to implement Achieve one-copy serializability Primary RM is performance bottleneck

Page 13: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Read one, Write all

Provides concurrency Concurrency control protocol needed to

ensure consistency (serialization) Achieve one-copy serializability Difficult to implement (there will be failed

TM to block any updates)

Page 14: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Read one, Write all available

Variation of Read one, Write all May not guarantee one-copy serializability Issue of loss conflict in transactions

Page 15: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Loss of Conflicts

Assume to RMs, (a,b), object X,Y replicated to both.

Two transactions T1:R(X),W(Y),commit T2:R(Y),W(X),commit

Page 16: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Loss of Conflict

If Xa,Yb failed, transaction as follows T1:R(Xa),(Yb failed),W(Ya),commit T2:R(Yb),(Xa failed),W(Xb),commit There is no conflict since no object is shared.

Thus loss conflict. This can introduce error.

Page 17: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Read quorum,Write quorum

Version number attached to replicated object Highest version numbered object is the latest

object in read. Write operation advances version by 1 Write quorum > half of all object copies Write quorum+read quorum > all object

copies

Page 18: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Gossip Update

Applicable for frequent read, less update situations

Increased performance Typical read one, write gossip Use timestamp

Page 19: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Basic Gossip Update

Used for overwrite Three operations, read, update, gossip arrive Read, if TSfsa<=TSrm, RM has recent data, return it,

otherwise wait for gossip, or try other RM Update, if Tsfsa>TSrm, update. Update TSrm send

gossip. Otherwise, process based on application, perform update or reject

Gossip arrive, update RM if gossip carries new updates.

Page 20: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Causal Order Gossip Protocol[3]

Used for read-modify In a fixed RM configuration Using vector timestamps Using buffer to keep the order

Page 21: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Windows Server 2003[4]

Support DFS “State based, multi master” scheduled

replication Use namespace for transparent file sharing Use Remote Differential Compression to

propagate change only to save bandwidth

Page 22: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Continued[5]

If replication detects a conflict, last update wins. No merge files, but copies are kept for reference.

Page 23: 6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.

Reference

[1] Wikipedia; http://en.wikipedia.org/wiki/Atomicity[2] M. T. Harandi;J. Hou (modified: I. Gupta);"Transactions with

Replication";http://www.crhc.uiuc.edu/~nhv/428/slides/repl-trans.ppt [3] Randy Chow,Theodore Johnson, “Distributed Operating Systems &

Algorithms”, 1998[4] "Overview of the Distributed File System Solution in Microsoft

Windows Server 2003 R2";http://technet2.microsoft.com/WindowsServer/en/library/d3afe6ee-3083-4950-a093-8ab748651b761033.mspx?mfr=true

[5] "Distributed File System Replication: Frequently Asked Questions";http://technet2.microsoft.com/WindowsServer/en/library/f9b98a0f-c1ae-4a9f-9724-80c679596e6b1033.mspx?mfr=true