EECS 482 Introduction to Operating Systems

Similar documents
Networks and distributed computing

Weak Consistency and Disconnected Operation in git. Raymond Cheng

NFS: Naming indirection, abstraction. Abstraction, abstraction, abstraction! Network File Systems: Naming, cache control, consistency

EECS 498 Introduction to Distributed Systems

Distributed Systems. Lec 9: Distributed File Systems NFS, AFS. Slide acks: Dave Andersen

416 Distributed Systems. Distributed File Systems 4 Jan 23, 2017

Distributed Systems 16. Distributed File Systems II

Distributed Systems. Before We Begin. Advantages. What is a Distributed System? CSE 120: Principles of Operating Systems. Lecture 13.

CA485 Ray Walshe Google File System

Today CSCI Coda. Naming: Volumes. Coda GFS PAST. Instructor: Abhishek Chandra. Main Goals: Volume is a subtree in the naming space

Consensus and related problems

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

EECS 498 Introduction to Distributed Systems

CS /15/16. Paul Krzyzanowski 1. Question 1. Distributed Systems 2016 Exam 2 Review. Question 3. Question 2. Question 5.

Distributed File Systems II

DISTRIBUTED SYSTEMS [COMP9243] Lecture 9b: Distributed File Systems INTRODUCTION. Transparency: Flexibility: Slide 1. Slide 3.

TAPIR. By Irene Zhang, Naveen Sharma, Adriana Szekeres, Arvind Krishnamurthy, and Dan Ports Presented by Todd Charlton

Distributed Systems. Lec 12: Consistency Models Sequential, Causal, and Eventual Consistency. Slide acks: Jinyang Li

Changing Requirements for Distributed File Systems in Cloud Storage

Distributed Systems. Lec 10: Distributed File Systems GFS. Slide acks: Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung

Distributed File Systems. CS 537 Lecture 15. Distributed File Systems. Transfer Model. Naming transparency 3/27/09

Distributed Systems - III

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions

EECS 482 Introduction to Operating Systems

Example File Systems Using Replication CS 188 Distributed Systems February 10, 2015

NPTEL Course Jan K. Gopinath Indian Institute of Science

C 1. Recap. CSE 486/586 Distributed Systems Distributed File Systems. Traditional Distributed File Systems. Local File Systems.

CLOUD-SCALE FILE SYSTEMS

Distributed Data Management Replication

EECS 482 Introduction to Operating Systems

EECS 498 Introduction to Distributed Systems

Advanced Operating Systems

Global atomicity. Such distributed atomicity is called global atomicity A protocol designed to enforce global atomicity is called commit protocol

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson

Network File Systems

Replication in Distributed Systems

Today: Coda, xfs! Brief overview of other file systems. Distributed File System Requirements!

Distributed Systems. Catch-up Lecture: Consistency Model Implementations

Consistency: Relaxed. SWE 622, Spring 2017 Distributed Software Engineering

Today: Distributed File Systems

AN OVERVIEW OF DISTRIBUTED FILE SYSTEM Aditi Khazanchi, Akshay Kanwar, Lovenish Saluja

Consistency and Replication

Current Topics in OS Research. So, what s hot?

Important Lessons. A Distributed Algorithm (2) Today's Lecture - Replication

Recall: Primary-Backup. State machine replication. Extend PB for high availability. Consensus 2. Mechanism: Replicate and separate servers

CS 138: Google. CS 138 XVI 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective

Distributed Data Analytics Transactions

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

FLAT DATACENTER STORAGE CHANDNI MODI (FN8692)

18-hdfs-gfs.txt Thu Oct 27 10:05: Notes on Parallel File Systems: HDFS & GFS , Fall 2011 Carnegie Mellon University Randal E.

EECS 498 Introduction to Distributed Systems

Distributed File Systems. CS432: Distributed Systems Spring 2017

Replications and Consensus

Replication and Consistency

CSE 5306 Distributed Systems. Fault Tolerance

CSE 5306 Distributed Systems

Consistency and Replication

Recap. CSE 486/586 Distributed Systems Google Chubby Lock Service. Recap: First Requirement. Recap: Second Requirement. Recap: Strengthening P2

Today: Distributed File Systems!

GFS Overview. Design goals/priorities Design for big-data workloads Huge files, mostly appends, concurrency, huge bandwidth Design for failures

DISTRIBUTED FILE SYSTEMS CARSTEN WEINHOLD

CS 138: Google. CS 138 XVII 1 Copyright 2016 Thomas W. Doeppner. All rights reserved.

Apache Cassandra - A Decentralized Structured Storage System

Distributed File Systems. Case Studies: Sprite Coda

CPS 512 midterm exam #1, 10/7/2016

Building Consistent Transactions with Inconsistent Replication

Consistency and Replication. Some slides are from Prof. Jalal Y. Kawash at Univ. of Calgary

416 Distributed Systems. Distributed File Systems 2 Jan 20, 2016

Chapter 17: Distributed Systems (DS)

Paxos Replicated State Machines as the Basis of a High- Performance Data Store

GFS: The Google File System

Practical Byzantine Fault

EECS 482 Introduction to Operating Systems

Introduction to Data Management CSE 344

Tradeoff Evaluation. Comparison between CB-R and CB-A as they only differ for this aspect.

Consistency & Replication

CSE 444: Database Internals. Lectures 26 NoSQL: Extensible Record Stores

Today: Coda, xfs. Case Study: Coda File System. Brief overview of other file systems. xfs Log structured file systems HDFS Object Storage Systems

MySQL Replication Options. Peter Zaitsev, CEO, Percona Moscow MySQL User Meetup Moscow,Russia

Distributed Filesystem

Extend PB for high availability. PB high availability via 2PC. Recall: Primary-Backup. Putting it all together for SMR:

Cloud Computing CS

Recap. CSE 486/586 Distributed Systems Google Chubby Lock Service. Paxos Phase 2. Paxos Phase 1. Google Chubby. Paxos Phase 3 C 1

Disconnected Operation in the Coda File System

Lecture 8: Transactional Memory TCC. Topics: lazy implementation (TCC)

References. What is Bigtable? Bigtable Data Model. Outline. Key Features. CSE 444: Database Internals

Linearizability CMPT 401. Sequential Consistency. Passive Replication

CSE 444: Database Internals. Lecture 25 Replication

CSCI 4717 Computer Architecture

Distributed File Systems. Directory Hierarchy. Transfer Model

GOOGLE FILE SYSTEM: MASTER Sanjay Ghemawat, Howard Gobioff and Shun-Tak Leung

Computing Parable. The Archery Teacher. Courtesy: S. Keshav, U. Waterloo. Computer Science. Lecture 16, page 1

Configuring IBM Spectrum Protect for IBM Spectrum Scale Active File Management

Distributed Data Management Transactions

File Locking in NFS. File Locking: Share Reservations

Introduction to Cloud Computing

EECS 482 Introduction to Operating Systems

Flat Datacenter Storage. Edmund B. Nightingale, Jeremy Elson, et al. 6.S897

Exploiting Commutativity For Practical Fast Replication. Seo Jin Park and John Ousterhout

Transcription:

EECS 482 Introduction to Operating Systems Winter 2018 Baris Kasikci (Thanks, Harsha Madhyastha and Jason Flinn for the slides!)

Distributed file systems Remote storage of data that appears local Examples: AFS Dropbox Google Drive Benefits?

Client-server design Copy of every file stored on server FS operations (read/write/etc.) are RPCs Client Server Client Write A OK Read A Data Downsides? EECS 482 Lecture 24

Caching for performance Can cache file system data at client: In memory (e.g., NFS) On disk (e.g., AFS) Benefits of client-side caching: Improves server scalability Better latency and throughput Reduces network traffic Can improve availability (disconnected operation)

Client-side caching Migrate or replicate: Migrate: Transfer sole copy from server to client Replicate: Create additional copy at client

Pessimistic concurrency ctrl. How to prevent inconsistency? Obtain lock before accessing data Similar to reader-writer locks 3 states for each replica: Invalid: no cached copy Shared: may read cached copy Exclusive: may read/write cached copy

State machine for cached copy invalid this client writes the file another client writes the file this client reads the file another client writes the file exclusive this client writes the file another client reads the file shared

Invalidation protocol Client Server Client Read file Shared? A Shared? A Shared, val=a Shared, val=a Write file Exclusive? Invalidate Read file A B Ack Downgrade Ack Shared? Read file Ack, val=b B Ack, val=b B

Order of operations Necessary to wait for invalidations? Client Server Client Read file Shared? A Shared? A Shared, val=a Shared, val=a Write file Exclusive? Invalidate Read file A B Downgrade Shared? Read file Ack, val=b B Ack, val=b B

Order of operations Necessary to wait for invalidations? Client Server Client Read file Shared? A Shared? A Shared, val=a Shared, val=a Write file Exclusive? Invalidate B Read file A Read file (A not B!)

Optimistic concurrency ctrl. How to prevent inconsistency? Allow clients to modify replicas freely Server detects and resolves conflicting updates How to detect conflicts Assign a version to each object (file, etc.) Increment the version on update Conflict if server version >= client version

Conflicting operations Client Fetch Read file data,ver=1 1 Write file Server Client 1 Fetch data,ver=1 Read file 1 Write file 2 Write,ver=2 Write,ver=2 2 2

Resolving conflicts Possible strategies? Last writer wins (AFS) Create multiple versions Automatically merge updates (git) Manually merge updates (also git sigh) Jim Gray: no free lunch You either block on a lock or create a conflict Are current DFS s optimistic or pessimistic?

Load balancing across servers Two options: Partition clients across servers Partition files across servers How to find a file?

Load balancing across servers A B C D E 0 1 2 3 4 5 6 7 8 9 10 11

Leveraging randomness Hash(server) maps to random location 0xffff 0x0000 server3 file1 file2 server1 server2 file3 file5 file4 server4

Adding a server Hash(server) maps to random location 0xffff 0x0000 server3 file1 file2 server1 server2 server5 file5 server4 file4 file3

Balancing load Some files hotter than others Equal files does not imply equal load How to mitigate?» Assign less regions to hot servers, more to cold

Replication across servers More servers à Likelihood of failure increases Replicate files to tolerate failures Example: Primary + backup» Write data by writing to both primary AND backup» Read data by reading from primary OR backup

Primary-Backup Client 1 Write Ack Primary 1 Write Ack Backup 1 Read Read

Handling failures When primary fails Backup becomes new primary Backup handles all reads/writes Primary recovers, syncs state, can become backup When backup fails Primary handles all reads/writes Backup recovers, syncs state

Fault tolerance What if backup fails before primary recovers? Data is unavailable, lost if failures permanent How can we tolerate 2 failures? Use 2 backups Need f+1 servers to tolerate f failures What are we assuming about failures?

Byzantine generals Say there s one commander C and two lieutenants L1 and L2 Goal: Decide whether to attack enemy or retreat Attack succeeds if at least 2 attack 1 of the 3 is a traitor Solution 1: L1 and L2 follow C s command to either attack or retreat Solution 2: C sends command to L1 and L2, who then exchange notes and follow majority

Byzantine generals C sends command to L1 and L2, who then exchange notes and follow majority Case 1: L2 is traitor C sends attack to both L1 and L2 L1 receives {attack, retreat} Case 2: C is traitor C sends attack to L1 and retreat to L2 L1 receives {attack, retreat}

Byzantine generals Need at least 4 generals to cope with 1 traitor 3f+1 generals to cope with f traitors (more on this in distributed systems classes) Solution: C sends command to L1, L2, and L3, who then exchange notes and follow majority Three cases: C sends 3 attacks C sends 2 attacks, 1 retreat C sends 1 attack, 2 retreats