Distributed Systems CS

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.
Chubby Lock server for distributed applications 1Dennis Kafura – CS5204 – Operating Systems.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Distributed Systems CS Consistency and Replication – Part II Lecture 11, Oct 10, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
Distributed File System: Design Comparisons II Pei Cao Cisco Systems, Inc.
University of Pennsylvania 11/21/00CSE 3801 Distributed File Systems CSE 380 Lecture Note 14 Insup Lee.
Distributed File System: Design Comparisons II Pei Cao.
Distributed File Systems Concepts & Overview. Goals and Criteria Goal: present to a user a coherent, efficient, and manageable system for long-term data.
Distributed File Systems
Distributed File Systems Overview  A file system is an abstract data type – an abstraction of a storage device.  A distributed file system is available.
CS 5204 (FALL 2005)1 Leases: An Efficient Fault Tolerant Mechanism for Distributed File Cache Consistency Gray and Cheriton By Farid Merchant Date: 9/21/05.
Introduction to DFS. Distributed File Systems A file system whose clients, servers and storage devices are dispersed among the machines of a distributed.
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.
Distributed File Systems
ENERGY-EFFICIENCY AND STORAGE FLEXIBILITY IN THE BLUE FILE SYSTEM E. B. Nightingale and J. Flinn University of Michigan.
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.
Distributed Systems CS Consistency and Replication – Part III Lecture 13, Oct 26, 2015 Mohammad Hammoud.
System Models Advanced Operating Systems Nael Abu-halaweh.
DISTRIBUTED FILE SYSTEM- ENHANCEMENT AND FURTHER DEVELOPMENT BY:- PALLAWI(10BIT0033)
CS6320 – Performance L. Grewe.
Nomadic File Systems Uri Moszkowicz 05/02/02.
Cloud Computing CS Distributed File Systems and Cloud Storage – Part II Lecture 13, Feb 27, 2012 Majd F. Sakr, Mohammad Hammoud and Suhail Rehman.
Distributed Systems CS
Chapter 25: Advanced Data Types and New Applications
Distributed Systems CS
Multiprocessor Cache Coherency
Consistency and Replication
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT -Sumanth Kandagatla Instructor: Prof. Yanqing Zhang Advanced Operating Systems (CSC 8320)
NFS and AFS Adapted from slides by Ed Lazowska, Hank Levy, Andrea and Remzi Arpaci-Dussea, Michael Swift.
Distributed Systems CS
Distributed Systems CS
Consistency Models.
Distributed Systems CS
Outline Announcements Fault Tolerance.
Outline Midterm results summary Distributed file systems – continued
Advanced Operating Systems Chapter 11 Distributed File systems 11
Distributed Systems CS
Distributed Systems CS
Consistency and Replication
Today: Coda, xFS Case Study: Coda File System
EECS 498 Introduction to Distributed Systems Fall 2017
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Distributed File Systems
Distributed Systems CS
Chapter 5 Exploiting Memory Hierarchy : Cache Memory in CMP
Distributed File Systems
Distributed Systems CS
Outline Announcements Lab2 Distributed File Systems 1/17/2019 COP5611.
Cary G. Gray David R. Cheriton Stanford University
CSE 451: Operating Systems Spring Module 21 Distributed File Systems
Distributed File Systems
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Distributed Systems CS
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.
Distributed Systems CS
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Outline Review of Quiz #1 Distributed File Systems 4/20/2019 COP5611.
THE GOOGLE FILE SYSTEM.
Last Class: Web Caching
Database System Architectures
Distributed File Systems
Distributed Systems CS
Update : about 8~16% are writes
Coherent caches Adapted from a lecture by Ian Watson, University of Machester.
CSE 486/586 Distributed Systems Consistency --- 2
Distributed File Systems
Presentation transcript:

Distributed Systems CS 15-440 Caching – Part III Lecture 16, November 8, 2017 Mohammad Hammoud

Today… Last Lecture: One-copy semantic and cache consistency Today’s Lecture: Continue with cache consistency Announcements: Project 2 is due on Nov 12 by midnight PS5 is out. It is due on Nov 15.

Key Questions What data should be cached and when? Fetching Policy How can updates be made visible everywhere? Consistency or Update Propagation Policy What data should be evicted to free up space? Cache Replacement Policy

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Leases A client places a request to obtain a finite-duration control from the server This duration is called a lease period (typically, for few seconds) There are three types of leases Read and write leases, assuming an invalidation-based protocol Multiple requestors can obtain read leases on the same object, but only one can get a write lease on any object Open leases, assuming a check-on-use protocol A requestor loses control when its lease expires However, it can renew the lease if needed

Clocks at Involved Machines are Assumed to be Synchronized Lease Renewal Example: (F) Server Sorry, I can give you a read lease for time Y on F Renew my read lease for another time Y on F Okay, you got an extension for Y time on your read lease over F Give me a read lease for time X on F (F) Client 1 Read F for duration Y Read F for duration Y Clocks at Involved Machines are Assumed to be Synchronized

Leases A write goes as follows, assuming an invalidation-based protocol: ([F1, <1, nl>, <2, nl>], [F2, <2, nl>], [F3, <3, nl>]) ([F1, <1, wl>], [F2, <2, nl>], [F3, <3, nl>]) ([F1, <1, nl>], [F2, <2, nl>], [F3, <3, nl>]) State: Server Go Ahead Write- back F1 Need to Write on F1 for time t Invalidate F1 (F1) Client 1 Write on F1 Ack (F1, F2) (F2) Client 2 (F3) Client 3 [Fi, <x, y>] = File Fi is cached at Client x and is either not leased (i.e., y = nl), or read-leased (y = rl), or write-lease (y = wl).

Leases What if a write request arrives to the server in between? It can be queued, until the previous request is satisfied Only one write can go at a time and multiple requests can be queued and serviced in a specific order (e.g., FIFO order) When serviced, the up-to-date copy has to be shipped to its site (as its copy has been invalidated before allowing the previous write to proceed) What if a read request arrives to the server in between? It can be queued as well After write is done, either another write is pursued singlehandedly, or one or more reads go in parallel In any case, the up-to-date copy has to be shipped as well

Client 2 can see up-to-date F1 without polling the server Leases An open goes as follows, assuming session-semantic: Time Intervals: t’ t’’’ t’ > t’’’  Push New Value ([F1, <2, t’>], [F2, <2, t’’>], [F3, <3, t>]) ([F1, <2, t’>, <1, t’’’>], [F2, <2, t’’>], [F3, <3, t>]) ([F1, <2, t’>, <1, E>], [F2, <2, t’’>], [F3, <3, t>]) State: Server Go Ahead Write- back F1 Open F1 for time t’’’ Push F1 (F1) Client 1 Write on F1 for time t’’’ (F1, F2) Client 2 Client 2 can see up-to-date F1 without polling the server (F3) Client 3 [Fi, <x, y>] = File Fi is cached at Client x and either has its lease expired (i.e., y = E), or valid till end of y.

Client 2 does NOT see up-to-date F1 (It can pull it after t’ expires) Leases An open goes as follows, assuming session-semantic: Time Intervals: t’ t’’’ t’ < t’’’  Do Not Push New Value ([F1, <2, t’>], [F2, <2, t’’>], [F3, <3, t>]) ([F1, <2, t’>, <1, t’’’>], [F2, <2, t’’>], [F3, <3, t>]) ([F1, <2, E>, <1, E>], [F2, <2, t’’>], [F3, <3, t>]) State: Server Go Ahead Write- back F1 Open F1 for time t’’’ (F1) Client 1 Write on F1 for time t’’’ (F1, F2) Client 2 Client 2 does NOT see up-to-date F1 (It can pull it after t’ expires) (F3) Client 3 [Fi, <x, y>] = File Fi is cached at Client x and either has its lease expired (i.e., y = E), or valid till end of y.

Leases In this case: A lease becomes a promise by the server that it will push updates to a client for a specified time (i.e., the lease duration) When a lease expires, the client is forced to poll the server for updates and pull the modified data if necessary The client can also renew its lease and get again updates pushed to its site for the new lease duration Flexibility in choices!

Leases Advantages: Generalizes the check-on-use and callback schemes Lease duration can be tuned to adapt to mutation rate It is a clean tuning knob for design flexibility Conceptually simple, yet flexible

Leases Disadvantages: Lease-holder has total autonomy during lease Load/priorities can change at the server Revocation (where a lease is withdrawn by the server from the lease- holder) can be incorporated In an invalidation-based, lease-based protocol: Writers will be delayed on an object until all the read leases on that object are expired Keep-alive callbacks are needed Stateful server, which typically implies inferior fault-tolerance and scalability (in terms of capacity and communication)

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Skip Scary Parts Basic Idea: Advantages: When write-sharing is detected, caching is turned off Afterwards, all references go directly to the master copy Caching is resumed when write-sharing ends Advantages: Precise single-copy semantics (even at byte-level consistency) Excellent fallback strategy Exemplifies good engineering: “Handle average case well; worst case safely” Good adaptation of caching aggressiveness to workload characteristics (i.e., patterns of reads and writes)

Skip Scary Parts Disadvantages: Server needs to be aware of every use of data Assuming it is used in conjunction with check-on-use Either clients expose their wills of making writes upon opening files Or the server relies on clients’ write-backs upon closing files (which indicate writes on files) Server maintains some monitoring state

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

A Primer: Eventual Consistency Many applications can tolerate inconsistency for a long time Webpage updates, Web Search – Crawling, indexing and ranking, Updates to DNS Server In such applications, it is acceptable and efficient if updates are infrequently propagated A caching scheme is termed as eventually consistent if: All replicas will gradually become consistent in the absence of updates

A Primer: Eventual Consistency Caching schemes typically apply eventual consistency if: Write-write conflicts are rare Very rare for two processes to write to the same object Generally, one client updates the data object E.g., One DNS server updates the name-to-IP mappings Rare conflicts can be handled through simple mechanisms, such as mutual exclusion Read-write conflicts are more frequent Conflicts where one process is reading an object, while another process is writing (or attempting to write) to a replica of it Eventually consistent schemes have to focus on efficiently resolving these conflicts

Faith-Based Caching Basic Idea (an implementation of eventual consistency): A client blindly assumes cached data is valid for a while Referred to as “trust period” E.g., In Sun NFSv3 cached files are assumed current for 3 seconds, while directories for 30 seconds A small variant is to set a time-to-live (TTL) field for each object It periodically checks (based on time since last check) the validity of cached data No communication occurs during trust period Advantages: Simple implementation Server is stateless

Event: Update Webpage-A Faith-Based Caching Disadvantages: Potential user-visible inconsistencies when a client accesses data from different replicas Consistency guarantees are typically needed for a single client while accessing cached copies (e.g., read-your-own-writes) Webpage-A Webpage-A Webpage-A Webpage-A Webpage-A Webpage-A Event: Update Webpage-A Webpage-A Webpage-A Webpage-A Webpage-A Webpage-A Webpage-A This becomes more of a consistency problem for server-side replication (we will discuss it later under server-side replication)

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck

Pass the Buck Basic Idea (another implementation of eventual consistency) Let the user trigger cache re-validation (hit “reload”) Otherwise, all cached copies are assumed valid Equivalent to infinite-TTL faith-based caching Advantages: Simple implementation Avoids frivolous cache maintenance traffic Server is stateless

Pass the Buck Disadvantages: Places burden on users Users may be clueless about levels of consistency needed Assumes existence of users Pain for write scripts/programs

Cache Consistency Approaches We will study 7 cache consistency approaches: Broadcast Invalidations Check on Use Callback Leases Skip Scary Parts Faith-Based Caching Pass the Buck Many minor variants over the years, but these have withstood the test of time!

Three Key Questions What data should be cached and when? Fetching Policy How can updates be made visible everywhere? Consistency or Update Propagation Policy What data should be evicted to free up space? Cache Replacement Policy

Next Class Discuss cache replacement policies