Distributed Systems CS 15-440 Consistency and Replication – Part IV Lecture 14, Oct 28, 2015 Mohammad Hammoud.

Slides:



Advertisements
Similar presentations
Replication. Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Advertisements

Consistency and Replication Chapter 7 Part II Replica Management & Consistency Protocols.
Consistency and Replication
Consistency and Replication (3). Topics Consistency protocols.
Consistency and Replication. Replication of data Why? To enhance reliability To improve performance in a large scale system Replicas must be consistent.
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Distributed Systems CS Consistency and Replication – Part II Lecture 11, Oct 10, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
Distributed Systems CS Consistency and Replication – Part III Lecture 12, Oct 12, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Distributed Systems CS Consistency and Replication – Part I Lecture 10, Oct 5, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class: Web Caching Use web caching as an illustrative example Distribution protocols –Invalidate.
Distributed Systems CS Case Study: Replication in Google Chubby Recitation 5, Oct 06, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Client-Centric.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class:Consistency Semantics Consistency models –Data-centric consistency models –Client-centric.
Distributed Systems (15-440) Mohammad Hammoud December 4 th, 2013.
Consistency & Replication Chapter No. 6
1 6.4 Distribution Protocols Different ways of propagating/distributing updates to replicas, independent of the consistency model. First design issue.
Design and Implement an Efficient Web Application Server Presented by Tai-Lin Han Date: 11/28/2000.
Consistency and Replication CSCI 4780/6780. Chapter Outline Why replication? –Relations to reliability and scalability How to maintain consistency of.
Consistency And Replication
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
Distributed Systems CS Consistency and Replication – Part II Lecture 11, Oct 2, 2013 Mohammad Hammoud.
Distributed File Systems Overview  A file system is an abstract data type – an abstraction of a storage device.  A distributed file system is available.
ECE200 – Computer Organization Chapter 9 – Multiprocessors.
Consistency and Replication Chapter 6. Release Consistency (1) A valid event sequence for release consistency. Use acquire/release operations to denote.
Consistency and Replication. Replication of data Why? To enhance reliability To improve performance in a large scale system Replicas must be consistent.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Outline Introduction (what’s it all about) Data-centric consistency Client-centric consistency Replica management Consistency protocols.
Consistency and Replication Distributed Software Systems.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Consistency.
第5讲 一致性与复制 §5.1 副本管理 Replica Management §5.2 一致性模型 Consistency Models
Eduardo Gutarra Velez. Outline Distributed Filesystems Motivation Google Filesystem Architecture The Metadata Consistency Model File Mutation.
Consistency and Replication Chapter 6 Presenter: Yang Jie RTMM Lab Kyung Hee University.
Replication (1). Topics r Why Replication? r System Model r Consistency Models – How do we reason about the consistency of the “global state”? m Data-centric.
Distributed Systems CS Consistency and Replication – Part IV Lecture 21, Nov 10, 2014 Mohammad Hammoud.
Computer Science Lecture 14, page 1 CS677: Distributed OS Last Class: Concurrency Control Concurrency control –Two phase locks –Time stamps Intro to Replication.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Distributed Systems CS Consistency and Replication – Part I Lecture 10, September 30, 2013 Mohammad Hammoud.
Replication (1). Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Distributed Systems CS Consistency and Replication – Part IV Lecture 13, Oct 23, 2013 Mohammad Hammoud.
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT By Jyothsna Natarajan Instructor: Prof. Yanqing Zhang Course: Advanced Operating Systems.
Consistency and Replication Chapter 6 Presenter: Yang Jie RTMM Lab Kyung Hee University.
Distributed Systems CS Consistency and Replication – Part III Lecture 13, Oct 26, 2015 Mohammad Hammoud.
Distributed Systems CS Consistency and Replication – Part I Lecture 11, Oct 19, 2015 Mohammad Hammoud.
On the Placement of Web Server Replicas Yu Cai. Paper On the Placement of Web Server Replicas Lili Qiu, Venkata N. Padmanabhan, Geoffrey M. Voelker Infocom.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Consistency and Replication CSCI 6900/4900. FIFO Consistency Relaxes the constraints of the causal consistency “Writes done by a single process are seen.
Distributed Systems CS
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT -Sumanth Kandagatla Instructor: Prof. Yanqing Zhang Advanced Operating Systems (CSC 8320)
Distributed Systems CS
The University of Adelaide, School of Computer Science
Distributed Systems CS
Distributed Systems CS
Distributed Systems CS
Outline Announcements Lab2 Distributed File Systems 1/17/2019 COP5611.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distributed Systems CS
Replica Placement Model: We consider objects (and don’t worry whether they contain just data or code, or both) Distinguish different processes: A process.
The University of Adelaide, School of Computer Science
Lecture 17 Multiprocessors and Thread-Level Parallelism
Outline Review of Quiz #1 Distributed File Systems 4/20/2019 COP5611.
Last Class: Web Caching
Lecture 17 Multiprocessors and Thread-Level Parallelism
The University of Adelaide, School of Computer Science
Lecture 17 Multiprocessors and Thread-Level Parallelism
Presentation transcript:

Distributed Systems CS Consistency and Replication – Part IV Lecture 14, Oct 28, 2015 Mohammad Hammoud

Today…  Last Session  Consistency and Replication – Part III  Client-Centric Consistency Models  Today’s Session  Consistency and Replication – Part IV  Replica Management & Consistency Protocols  Announcements:  P2 is due on Sunday, Nov 1 st by midnight  Your virtual clusters will be ready by tomorrow- we will show you how to login and run sample MPI and MapReduce programs over them tomorrow during the recitation 2

Overview Consistency Models Data-centric Consistency Models Client-centric Consistency Models Replica Management Replica Server Placement Content Replication and Placement Consistency Protocols Primary-based protocols Replicated-write protocols Cache-coherence protocols 3

Summary of Consistency Models 4 Consistency Models Data-centric Models for Specifying Consistency Continuous Consistency Model Models for Consistent Ordering of Operations Sequential Consistency Model Causal Consistency Model Client-centric Eventual Consistency Client Consistency Guarantees Monotonic Reads Read your writes Write follow reads

Overview Consistency Models Data-centric Consistency Models Client-centric Consistency Models Replica Management Replica Server Placement Content Replication and Placement Consistency Protocols Primary-based protocols Replicated-write protocols Cache-coherence protocols 5

Replica Management Replica management describes where, when and by whom replicas should be placed We will study two problems under replica management 1.Replica-Server Placement Decides the best locations to place the replica servers that can host data-stores 2.Content Replication and Placement Finds the best server for placing the contents 6

Overview Consistency Models Data-centric Consistency Models Client-centric Consistency Models Replica Management Replica Server Placement Content Replication and Placement Consistency Protocols Primary-based protocols Replicated-write protocols Cache-coherence protocols 7

Replica Server Placement Factors that affect placement of replica servers: What are the possible locations where servers can be placed? Should we place replica servers close-by or distribute them uniformly? How many replica servers can be placed? What are the trade-offs between placing many replica servers vs. few? How many clients are accessing the data from a location? More replicas at locations where most clients access improves performance and fault-tolerance If K replicas have to be placed out of N possible locations, find the best K out of N locations (K<N) 8

Replica Server Placement – An Example Approach Problem: K replica servers should be placed on some of the N possible replica sites such that Clients have low-latency/high-bandwidth connections Qiu et al. [2] suggested a Greedy Approach 9 1.Evaluate the cost of placing a replica on each of the N potential sites Examining the cost of C clients connecting to the replica Cost of a link can be 1/bandwidth or latency 2.Choose the lowest-cost site 3.In the second iteration, search for a second replica site which, in conjunction with the already selected site, yields the lowest cost 4.Iterate steps 2,3 and 4 until K replicas are chosen R2R2 R2R2 R3R3 R3R3 R4R4 R4R4 R1R1 R1R1 C=100 C=40 C=90 C=60 R2R2 R3R3

Overview Consistency Models Data-centric Consistency Models Client-centric Consistency Models Replica Management Replica Server Placement Content Replication and Placement Consistency Protocols Primary-based protocols Replicated-write protocols Cache-coherence protocols 10

Content Replication and Placement In addition to the server placement, it is important to know: how, when and by whom different data items (contents) are placed on possible replica servers Identify how webpage replicas are replicated: 11 Primary Servers in an organization Permanent Replicas Server-initiated Replicas Client-initiated Replicas Replica Servers on external hosting sites

Logical Organization of Replicas Permanent Replicas 12 Server-Initiated Replicas Client-initiated Replicas Clients Client-initiated ReplicationServer-initiated Replication

1. Permanent Replicas Permanent replicas are the initial set of replicas that constitute a distributed data-store Typically, small in number There can be two types of permanent replicas: Primary replicas One or more servers in an organization Whenever a request arrives, it is forwarded into one of the primary replicas Mirror sites Geographically spread, and replicas are generally statically configured Clients pick one of the mirror sites to download the data 13

2. Server-initiated Replicas A third party (provider) owns the secondary replica servers, and they provide hosting service The provider has a collection of servers across the Internet The hosting service dynamically replicates files on different servers E.g., Based on the popularity of a file in a region The permanent server chooses to host the data item on different secondary replica servers The scheme is efficient when updates are rare Examples of Server-initiated Replicas Replicas in Content Delivery Networks (CDNs) 14

Dynamic Replication in Server-initiated Replicas Dynamic replication at secondary servers: Helps to reduce the server load and improve client performance But, replicas have to dynamically push the updates to other replicas 15 Rabinovich et al. [3] proposed a distributed scheme for replication: Each server keeps track of: i.which is the closest server to the requesting client ii.number of requests per file per closest server For example, each server Q keeps track of cnt Q (P,F) which denotes how many requests arrived at Q which are closer to server P (for a file F ) If cnt Q (P,F) > 0.5 * cnt Q (Q,F) Request P to replicate a copy of file F If cnt P (P,F) < LOWER_BOUND Delete the file at replica Q If some other server is nearer to the clients, request replication over that server If the replication is not popular, delete the replica

3. Client-initiated Replicas Client-initiated replicas are known as client caches Client caches are used only to reduce the access latency of data e.g., Browser caching a web-page locally Typically, managing a cache is entirely the responsibility of a client Occasionally, data-store may inform client when the replica has become stale 16

Summary of Replica Management Replica management deals with placement of servers and content for improving performance and fault-tolerance 17 Replica Management Permanent Replicas Server Initiated Replicas Client Initiated Replicas So far, we know: how to place replica servers and content the required consistency models for applications What else do we need to provide consistency in a distributed system?

Overview Consistency Models Data-centric Consistency Models Client-centric Consistency Models Replica Management Replica Server Placement Content Replication and Placement Consistency Protocols Primary-based protocols Replicated-write protocols Cache-coherence protocols 18

Consistency Protocols A consistency protocol describes the implementation of a specific consistency model We are going to study three consistency protocols: Primary-based protocols One primary coordinator is elected to control replication across multiple replicas Replicated-write protocols Multiple replicas coordinate together to provide consistency guarantees Cache-coherence protocols A special case of client-controlled replication 19

Overview of Consistency Protocols 20 Consistency Protocols Primary-based Protocols Replicated-Write Protocols Cache Coherence Protocols

Primary-based protocols In Primary-based protocols, a simple centralized design is used to implement consistency models Each data-item x has an associated “Primary Replica” The primary replica is responsible for coordinating write operations We will study one example of Primary-based protocols that implements Sequential Consistency Model Remote-Write Protocol 21

Remote-Write Protocol Rules: All write operations are forwarded to the primary replica Read operations are carried out locally at each replica Approach for write ops: (Budhiraja et al. 1993) 22 Client connects to some replica R C If the client issues write operation to R C : R C forwards the request to the primary replica R P R P updates its local value R P forwards the update to other replicas R i Other replicas R i update, and send an ACK back to R P After R P receives all ACKs, it informs R C that the write operation is completed R C acknowledges the client, which in return completes the write operation R3R3 R3R3 R1R1 R1R1 R2R2 Primary server x+=5 Client 1 x 1 =0 x 2 =0 x 3 =0x 2 =5 x 1 =5 x 3 =5 Data-store

Remote-Write Protocol – Discussion The Remote-Write protocol provides A simple way to implement sequential consistency Guarantees that clients see the most recent write operations However, latency is high in Remote-Write Protocols Clients block until all the replicas are updated Can a non-blocking strategy be applied? Remote-Write Protocols are applied to distributed databases and file systems that require fault-tolerance Replicas are placed on the same LAN to reduce latency 23

Overview of Consistency Protocols 24 Consistency Protocols Primary-based Protocols Remote-Write Protocol Replicated- Write Protocols Cache Coherence Protocols

Replicated-Write Protocol In a replicated-write protocol, updates can be carried out at multiple replicas We will study one example on replicated-write protocols called Active Replication Protocol Here, clients write at any replica The modified replica will propagate updates to other replicas 25

Active Replication Protocol When a client writes at a replica, the replica will send the write operation updates to all other replicas Challenges with Active Replication Ordering of operations cannot be guaranteed across the replicas 26 R3R3 R3R3 R1R1 R1R1 Client 1 x 1 =0 x 2 =0 x 3 =0 Data-store x+=2 R2R2 R2R2 Client 2 x*=3 x 1 =2 x 2 =2 x 3 =2x 3 =6 x 2 =6 x 1 =6 W(x) R2R2 R2R2 R3R3 R3R3 R1R1 R1R1 R(x)2 W(x) R(x)2 R(x)0 R(x)6 x+=2 x*=3 R(x)2 R(x)6

Centralized Active Replication Protocol Approach There is a centralized coordinator called the sequencer ( Seq ) When a client connects to a replica R C and issues a write operation R C forwards the update to the Seq Seq assigns a sequence number to the update operation R C propagates the sequence number and the operation to other replicas Operations are carried out at all the replicas in the order defined by the sequencer 27 R3R3 R3R3 R1R1 R1R1 Client 1 Data-store x+=5 R2R2 R2R2 Client 2 x-=2 Seq 10 x+=5 x-=2 11

Overview of Consistency Protocols 28 Consistency Protocols Primary-based Protocols Remote-Write Protocols Replicated-Write Protocols Active Replication Protocol Cache Coherence Protocols

Caches are special types of replicas Typically, caches are client-controlled replicas Cache coherence refers to the consistency of data stored in caches How are the cache coherence protocols in shared- memory multiprocessor (SMP) systems different from those in Distributed Systems? Coherence protocols in SMP assume cache states can be broadcasted efficiently In DS, this is difficult because caches may reside on different machines 29

Cache Coherence Protocols (Cont’d) Cache Coherence protocols determine how caches are kept consistent Caches may become inconsistent when a data item is modified: 1.at the server replicas, or 2.at the cache 30

When Data is Modified at the Server Two approaches for enforcing coherence: 1.Server-initiated invalidation Here, server sends all caches an invalidation message (when data item is modified) 2.Server updates the cache Server will propagate the update to the cache 31

When Data is Modified at the Cache The enforcement protocol may use one of three techniques: i.Read-only cache The cache does not modify the data in the cache The update is propagated to the server replica ii.Write-through cache Directly modify the cache, and forward the update to the server iii.Write-back cache The client allows multiple writes to take place at the cache The client batches a set of writes, and will send the batched write updates to the server replica 32

Summary of Consistency Protocols 33 Consistency Protocols Primary-based Protocols Remote-Write Protocols Replicated-Write Protocols Active Replication Protocol Cache Coherence Protocols Coherence Enforcement Strategies

Consistency and Replication – Brief Summary Replication improves performance and fault-tolerance However, replicas have to be kept reasonably consistent 34 A contract between the data-store and processes Types: Data-centric and Client-centric Consistency Models Describes where, when and by whom replicas should be placed Types: Replica Server Placement, Content Replication and Placement Replication Management Implement Consistency Models Types: Primary-based, Replicated-Write, Cache Coherence Consistency Protocols

Next Class + Programming Models- Part I 35

References [1] Terry, D.B., Demers, A.J., Petersen, K., Spreitzer, M.J., Theimer, M.M., Welch, B.B., "Session guarantees for weakly consistent replicated data", Proceedings of the Third International Conference on Parallel and Distributed Information Systems, 1994 [2] Lili Qiu, Padmanabhan, V.N., Voelker, G.M., “On the placement of Web server replicas”, Proceedings of IEEE INFOCOM [3] Rabinovich, M., Rabinovich, I., Rajaraman, R., Aggarwal, A., “A dynamic object replication and migration protocol for an Internet hosting service”, Proceedings of IEEE International Conference on Distributed Computing Systems (ICDCS), 1999 [4] 36