1 CS 194: Distributed Systems Distributed Commit, Recovery Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering.

Slides:



Advertisements
Similar presentations
CS542: Topics in Distributed Systems Distributed Transactions and Two Phase Commit Protocol.
Advertisements

(c) Oded Shmueli Distributed Recovery, Lecture 7 (BHG, Chap.7)
CS 603 Handling Failure in Commit February 20, 2002.
CIS 720 Concurrency Control. Timestamp-based concurrency control Assign a timestamp ts(T) to each transaction T. Each data item x has two timestamps:
Computer Science Lecture 18, page 1 CS677: Distributed OS Last Class: Fault Tolerance Basic concepts and failure models Failure masking using redundancy.
ICS 421 Spring 2010 Distributed Transactions Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 3/16/20101Lipyeow.
Systems of Distributed Systems Module 2 -Distributed algorithms Teaching unit 3 – Advanced algorithms Ernesto Damiani University of Bozen Lesson 6 – Two.
Computer Science Lecture 17, page 1 CS677: Distributed OS Last Class: Fault Tolerance Basic concepts and failure models Failure masking using redundancy.
Recovery Fall 2006McFadyen Concepts Failures are either: catastrophic to recover one restores the database using a past copy, followed by redoing.
Distributed Systems CS Fault Tolerance- Part III Lecture 15, Oct 26, 2011 Majd F. Sakr, Mohammad Hammoud andVinay Kolar 1.
CS-550 (M.Soneru): Recovery [SaS] 1 Recovery. CS-550 (M.Soneru): Recovery [SaS] 2 Recovery Computer system recovery: –Restore the system to a normal operational.
CS 603 Three-Phase Commit February 22, Centralized vs. Decentralized Protocols What if we don’t want a coordinator? Decentralized: –Each site broadcasts.
1 More on Distributed Coordination. 2 Who’s in charge? Let’s have an Election. Many algorithms require a coordinator. What happens when the coordinator.
1 ICS 214B: Transaction Processing and Distributed Data Management Distributed Database Systems.
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 1) Academic Year 2014 Spring.
A Survey of Rollback-Recovery Protocols in Message-Passing Systems M. Elnozahy, L. Alvisi, Y. Wang, D. Johnson Carnegie Mellon University Presented by:
1 Rollback-Recovery Protocols II Mahmoud ElGammal.
CS162 Section Lecture 10 Slides based from Lecture and
Checkpointing and Recovery. Purpose Consider a long running application –Regularly checkpoint the application Expensive task –In case of failure, restore.
Distributed Transactions March 15, Transactions What is a Distributed Transaction?  A transaction that involves more than one server  Network.
Chapter 19 Recovery and Fault Tolerance Copyright © 2008.
Distributed Transactions Chapter 13
Distributed Systems CS Fault Tolerance- Part III Lecture 19, Nov 25, 2013 Mohammad Hammoud 1.
Distributed Systems Principles and Paradigms Chapter 07 Fault Tolerance 01 Introduction 02 Communication 03 Processes 04 Naming 05 Synchronization 06 Consistency.
1 8.3 Reliable Client-Server Communication So far: Concentrated on process resilience (by means of process groups). What about reliable communication channels?
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
EEC 688/788 Secure and Dependable Computing Lecture 7 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
12. Recovery Study Meeting M1 Yuuki Horita 2004/5/14.
CS5204 – Operating Systems 1 Checkpointing-Recovery.
Distributed Transaction Management, Fall 2002Lecture Distributed Commit Protocols Jyrki Nummenmaa
Fault Tolerance CSCI 4780/6780. Distributed Commit Commit – Making an operation permanent Transactions in databases One phase commit does not work !!!
University of Tampere, CS Department Distributed Commit.
Chapter 2 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University Building Dependable Distributed Systems.
More on Fault Tolerance Chapter 7. Topics Group Communication Virtual Synchrony Atomic Commit Checkpointing, Logging, Recovery.
Committed:Effects are installed to the database. Aborted:Does not execute to completion and any partial effects on database are erased. Consistent state:
Fault Tolerance Chapter 7.
Revisiting failure detectors Some of you asked questions about implementing consensus using S - how does it differ from reaching consensus using P. Here.
EEC 688/788 Secure and Dependable Computing Lecture 6 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Multi-phase Commit Protocols1 Based on slides by Ken Birman, Cornell University.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
1 Fault Tolerance and Recovery Mostly taken from
Operating System Reliability Andy Wang COP 5611 Advanced Operating Systems.
Chapter 8 – Fault Tolerance Section 8.5 Distributed Commit Heta Desai Dr. Yanqing Zhang Csc Advanced Operating Systems October 14 th, 2015.
More on Fault Tolerance
8.6. Recovery By Hemanth Kumar Reddy.
Outline Introduction Background Distributed DBMS Architecture
Two phase commit.
Operating System Reliability
Operating System Reliability
Commit Protocols CS60002: Distributed Systems
Outline Announcements Fault Tolerance.
Operating System Reliability
Operating System Reliability
EEC 688/788 Secure and Dependable Computing
Distributed Systems CS
Distributed Systems CS
Recovery System.
Distributed Transactions
Operating System Reliability
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
CIS 720 Concurrency Control.
Last Class: Fault Tolerance
Operating System Reliability
Operating System Reliability
Presentation transcript:

1 CS 194: Distributed Systems Distributed Commit, Recovery Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Berkeley, CA

2 Distributed Commit  Goal: Either all members of a group decide to perform an operation, or none of them perform the operation

3 Assumptions  Failures: -Crash failures that can be recovered -Communication failures detectable by timeouts  Notes: -Commit requires a set of processes to agree… -…similar to the Byzantine general problem… -… but the solution much simpler because stronger assumptions

4 Two Phase Commit (2PC) send VOTE_REQ to all send vote to coordinator if (vote == no) decide abort halt if (all votes yes) decide commit send COMMIT to all else decide abort send ABORT to all who voted yes halt if receive ABORT, decide abort else decide commit halt Coordinator Participants

5 2PC State Machine a) The finite state machine for the coordinator in 2PC b) The finite state machine for a participant

6 2PC: Crash Recovery Protocol Stable storage is persistent memory that supports writes that are atomic with respect to failures Log actions:  c sends VOTE_REQwrite start  p votes YESwrite yes  p votes NOwrite abort  c decides commitwrite commit  c decides abortwrite abort  p receives decisionwrite decision commit point

7 2PC: Crash Recovery Protocol Upon recovery a process r starts reading the values logged to stable storage.  If there is a start then r was the coordinator: -If there is a subsequent abort or commit then decision was made; otherwise decide abort.  Otherwise, r was a participant: -If there is abort or commit then the decision was made; -If there is no yes then decide abort. -Otherwise (i.e., there is an yes record) run termination protocol.... when can these records be garbage collected?

8 Recovery Techniques: Checkpoints  Goal: recover a process from error  Backward recovery: checkpoint the state of the process periodically -Go to previous checkpoint, if error -Problem: same failure may repeat  Forward recovery: go to a known good state if error -Problem: need to know in advance which error may occur

9 Example: Reliable Communication  Backward recovery: retransmit packet if lost  Forward recovery: use erasure coding -Instead of sending k packets, send n > k using erasure coding -As long as receiver gets at least k packets out of n, it can reconstruct the original k packets

10 Recovery Techniques: Message Logging  Sender based: sender logs message before sending it out  Receiver based: receiver logs message before delivering it  Replay log messages between checkpoints  restore state beyond most recent checkpoint

11 Distributed Checkpointing: Recovery Line  Recovery line: most recent snapshot -If a process P has recorder the receipt of message m there should be a process Q that recorded sending of message m  How do you find a recover line?

12 Independent Checkpointing: The Domino Effect  Domino effect: cascaded rollback to find a recovery line  Solutions: -Coordinate checkpointing: use two-phase non-blocking protocol (see the book) -Logging and replaying messages

13 Message Logging and Checkpointing  Incorrect replay of messages after recovery, leading to an orphan process

14 Stable Storage  Storage designed to survive anything except major calamities  Use two disks to record identical information 1)Write and verify sector on disk 1 2)Write and verify sector on disk 2  Recovery -Verify all sectors -If two corresponding sectors differ, copy sector from disk 1 to disk

15 Stable Storage Recovery a) Stable Storage b) Crash after drive 1 is updated c) Bad spot