EECS 498 Introduction to Distributed Systems Fall 2017

Slides:



Advertisements
Similar presentations
Wait-free coordination for Internet-scale systems
Advertisements

Two phase commit. Failures in a distributed system Consistency requires agreement among multiple servers –Is transaction X committed? –Have all servers.
Replication techniques Primary-backup, RSM, Paxos Jinyang Li.
Sanjay Ghemawat, Howard Gobioff and Shun-Tak Leung
The SMART Way to Migrate Replicated Stateful Services Jacob R. Lorch, Atul Adya, Bill Bolosky, Ronnie Chaiken, John Douceur, Jon Howell Microsoft Research.
Chubby Lock server for distributed applications 1Dennis Kafura – CS5204 – Operating Systems.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Google Chubby Lock Service Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Fault-tolerance techniques RSM, Paxos Jinyang Li.
CSS490 Replication & Fault Tolerance
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 18: Replication Control All slides © IG.
The Chubby lock service for loosely-coupled distributed systems Mike Burrows (Google), OSDI 2006 Shimin Chen Big Data Reading Group.
Fault Tolerance via the State Machine Replication Approach Favian Contreras.
IM NTU Distributed Information Systems 2004 Replication Management -- 1 Replication Management Yih-Kuen Tsay Dept. of Information Management National Taiwan.
Paxos A Consensus Algorithm for Fault Tolerant Replication.
Fault Tolerant Services
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Google Chubby Lock Service Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Google Chubby Lock Service Steve Ko Computer Sciences and Engineering University at Buffalo.
© Spinnaker Labs, Inc. Chubby. © Spinnaker Labs, Inc. What is it? A coarse-grained lock service –Other distributed systems can use this to synchronize.
Detour: Distributed Systems Techniques
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Chapter 3 System Models.
Replication Chapter Katherine Dawicki. Motivations Performance enhancement Increased availability Fault Tolerance.
Ion Stoica, UC Berkeley November 7, 2016
Primary-Backup Replication
CS6320 – Performance L. Grewe.
Distributed Systems – Paxos
CPS 512 midterm exam #1, 10/7/2016 Your name please: ___________________ NetID:___________ /60 /40 /10.
Lecture 17: Leader Election
Google File System CSE 454 From paper by Ghemawat, Gobioff & Leung.
Distributed Transactions and Spanner
View Change Protocols and Reconfiguration
EECS 498 Introduction to Distributed Systems Fall 2017
MVCC and Distributed Txns (Spanner)
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
Implementing Consistency -- Paxos
Consistency Models.
EECS 498 Introduction to Distributed Systems Fall 2017
آزمايشگاه سيستمهای هوشمند علی کمالی زمستان 95
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
Outline Announcements Fault Tolerance.
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
Ali Ghodsi and Ion Stoica, UC Berkeley February 21, 2018
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
Active replication for fault tolerance
Fault-tolerance techniques RSM, Paxos
PERSPECTIVES ON THE CAP THEOREM
CS 425 / ECE 428 Distributed Systems Fall 2017 Indranil Gupta (Indy)
EEC 688/788 Secure and Dependable Computing
EECS 498 Introduction to Distributed Systems Fall 2017
EEC 688/788 Secure and Dependable Computing
IS 651: Distributed Systems Fault Tolerance
Scalable Causal Consistency
Lecture 21: Replication Control
Fault-Tolerant State Machine Replication
EECS 498 Introduction to Distributed Systems Fall 2017
Concurrency Control II and Distributed Transactions
Replicated state machine and Paxos
View Change Protocols and Reconfiguration
by Mikael Bjerga & Arne Lange
The SMART Way to Migrate Replicated Stateful Services
Lecture 21: Replication Control
Implementing Consistency -- Paxos
Presentation transcript:

EECS 498 Introduction to Distributed Systems Fall 2017 Harsha V. Madhyastha

Implementing RSMs Logical clock based ordering of requests Cannot serve requests if any one replica is down Primary-backup replication Replace primary/backup upon failure Relies on always available view service Paxos-based replicated service Available as long as majority in same partition October 9, 2017 EECS 498 - Lecture 10

Today: Case Studies Chubby ZooKeeper October 9, 2017 EECS 498 - Lecture 10

Chubby Internal service within Google Highly available coordination service October 9, 2017 EECS 498 - Lecture 10

Chubby Internal service within Google Highly available coordination service Two purposes: Lock service File system (for small files) October 9, 2017 EECS 498 - Lecture 10

Example: GFS Chunkmaster x = Open(“/ls/gfs-cell8/chunkmaster") if (TryAcquire(x) == success) { // I'm the chunkmaster, tell everyone SetContents(x, my-address) } else { // I'm not the master, find out who is chunkmaster = GetContents(x) }

Why this interface? Why not a library that implements Paxos? Developers do not know how to use Paxos They at least think they know how to use locks! Need to export result of coordination outside of system Example: Clients need to discover GFS master

Replicated service using Paxos to implement fault-tolerant log Chubby Design Replicated service using Paxos to implement fault-tolerant log

Chubby in Action Modify file foo ? Read file foo

Reads in Paxos-based RSM For every key, every replica stores (value, version) Return latest version out of majority of replicas V1 Read file foo V2 V1 V3 Read file foo V2 Why do different replicas have different versions? Gap between Accept and Learn

Reads in Paxos-based RSM How to ensure linearizability? A read must see the effect of all accepted writes Get read accepted to one of the slots in replicated log Every replica executes command in a slot only after executing commands in all prior slots

RSM with Paxos Slots in log Proposals / ballots October 9, 2017 EECS 498 - Lecture 10

Reads in Paxos-based RSM How to ensure linearizability? A read sees the effect of all accepted writes Get read accepted to one of the slots in replicated log Problem: Poor performance at scale

Reads/Writes in Chubby One of the 5 replicas chosen as the master Clients submit all reads and writes to master How to handle master failure? Another replica must propose itself as master New master must first “catch up” Master is performance bottleneck

Scaling Chubby Clients cache data they read Reading from local cache violates linearizability How to fix this? Master invalidates cached copies upon update Master must store knowledge of client caches What if master fails?

Scaling Chubby with Proxies Proxy Proxy Chubby

Handling client failures What if a client acquires a lock and fails? Client library exchanges keep-alives with master Lock revoked upon client failure Problem? Network partition not client failure Chubby associates lock acquisitions with sequence numbers Can distinguish operations from previous lock holders

Discrepancy in Lock Validity Lock service Replica 1 Client2 Client1 Replica 2 Check with lock service to confirm lock validity Replica 3 October 9, 2017 EECS 498 - Lecture 10

ZooKeeper Open source coordination service Addresses need for polling in Chubby Example: If you cannot acquire lock, need to retry Goal in ZooKeeper: Wait-free coordination October 9, 2017 EECS 498 - Lecture 10

ZooKeeper: Watch mechanism Clients can register to “watch” a file ZooKeeper notifies client when file is updated Example: Try to acquire a lock by creating a file If file already exists, watch for updates Upon watch notification, try to re-acquire lock Problem? Herd effect October 9, 2017 EECS 498 - Lecture 10

ZooKeeper: Hierarchy October 9, 2017 EECS 498 - Lecture 10

ZooKeeper: Sequencer lock-1 lock-2 lock-3 October 9, 2017 EECS 498 - Lecture 10

Chubby vs. ZooKeeper Difference between invalidation and watch? Only library receives notification to update cache Watch: Application receives notification Only app knows what it needs to do October 9, 2017 EECS 498 - Lecture 10