Distributed Systems CS 15-440 Consistency and Replication – Part IV Lecture 13, Oct 23, 2013 Mohammad Hammoud.

Slides:



Advertisements
Similar presentations
Consistency and Replication Chapter 7 Part II Replica Management & Consistency Protocols.
Advertisements

Consistency and Replication
Consistency and Replication (3). Topics Consistency protocols.
Consistency and Replication Chapter 6. Object Replication (1) Organization of a distributed remote object shared by two different clients.
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 Spring 2009
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 14, page 1 CS677: Distributed OS Consistency and Replication Today: –Introduction –Consistency models Data-centric consistency.
More on Replication and Consistency CS-4513, D-Term More on Replication and Consistency CS-4513 D-Term 2007 (Slides include materials from Operating.
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 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 Client-Centric.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class:Consistency Semantics Consistency models –Data-centric consistency models –Client-centric.
More on Replication and Consistency CS-4513 D-term More on Replication and Consistency CS-4513 Distributed Computing Systems (Slides include materials.
University of Pennsylvania 11/21/00CSE 3801 Distributed File Systems CSE 380 Lecture Note 14 Insup Lee.
File Systems (2). Readings r Silbershatz et al: 11.8.
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.
Consistency and Replication CSCI 4780/6780. Chapter Outline Why replication? –Relations to reliability and scalability How to maintain consistency of.
Consistency And Replication
Distributed File Systems
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
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
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.
Chapter 7 Consistency And Replication (CONSISTENCY PROTOCOLS)
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.
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.
Distributed Systems CS Consistency and Replication – Part IV Lecture 14, Oct 28, 2015 Mohammad Hammoud.
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
Distributed Systems CS
Outline Midterm results summary Distributed file systems – continued
Distributed File Systems
Distributed Systems CS
Distributed File Systems
Outline Announcements Lab2 Distributed File Systems 1/17/2019 COP5611.
Distributed File Systems
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.
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 13, Oct 23, 2013 Mohammad Hammoud

Today…  Last Session:  Consistency and Replication- Past III  Client-centric consistency models and replica management  Today’s Session:  Consistency and Replication – Part IV  Consistency Protocols  Programming Models – Part I  Announcements:  Project II is due today by 11:59PM  Project III will be posted by tonight (and is due on Nov 6, 2013) 2

Overview Consistency Models Replica Management Consistency Protocols 3

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 4

Overview of Consistency Protocols 5 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 6

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) 7 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 8

Overview of Consistency Protocols 9 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 10

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 11 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 12 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 13 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 14

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 15

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 16

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 17

Summary of Consistency Protocols 18 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 19 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

Back-up Slides 20

Overview of Consistency Protocols 21 Consistency Protocols Primary-based Protocols Remote-Write Protocols Local-Write Protocols Replicated-Write Protocols Cache Coherent Protocols

Local-Write Protocols Can we make Remote-Write better (e.g., for mobile computers that are able to operate in disconnected mode) Approach: 22 Client connects to some replica R C If the client issues write op to R C : R C becomes the primary replica R P Rest of the protocol is similar to Remote-Write R3R3 R3R3 R1R1 R1R1 R2R2 Primary server Client 1 x 1 =0 x 2 =0 x 3 =0 x 1 =5 Data-store x+=5 R1R1 R2R2 R2R2 x 2 =5x 3 =5

Local-Write Protocol Advantages Primary replica can propagate a batch of write updates instead of an individual update Multiple, successive write operations can be carried out locally, while reading processes can still access their local copies Scenarios where Local-Write is applicable: Mobile computers when disconnected (all updates can be carried locally, while other processes can still perform read operations- but not updates) Scenarios where Local-Write is inappropriate: When (multiple) clients are writing at multiple replicas Overhead of reassigning primary replica is high 23

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

Two aspects of Cache Coherence Protocols In order to maintain consistent caches, we need to perform two operations: Coherence detection strategies Detect inconsistent caches Coherence enforcement strategies Update caches 25

Overview of Consistency Protocols 26 Consistency Protocols Primary-based Protocols Remote-Write Protocols Replicated-Write Protocols Active Replication Protocol Cache Coherence Protocols Coherence Detection Strategies Coherence Enforcement Strategies

Coherence Detection Strategies Detection strategies deal with predicting when caches are inconsistent Since different replicas may be written by client processes, the protocol has to dynamically detect cache inconsistency 27

Coherence Detection Strategies In a distributed system, cache inconsistencies can be typically detected at three stages: 1.Verify coherence before every access Before every read or write operation 2.Verify coherence before a write access Cache coherence is checked before every write operation 3.Verify coherence after a write access First, an update is performed, and later cache consistency is verified If cache was inconsistent The write operation is rolled-back, and re-performed 28

Overview of Consistency Protocols 29 Consistency Protocols Primary-based Protocols Remote-Write Protocols Replicated-Write Protocols Active Replication Protocol Cache Coherence Protocols Coherence Detection Strategies Coherence Enforcement Strategies

Enforcement strategies determine how caches are kept consistent Caches may become inconsistent when 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