Faults and Recovery Ludovic Henrio CNRS - projet OASIS Sources: - A survey of rollback-recovery protocols in message-passing systems.

Slides:



Advertisements
Similar presentations
Distributed Snapshots: Non-blocking checkpoint coordination protocol Next: Uncoordinated Chkpnt.
Advertisements

Global States.
Lecture 8: Asynchronous Network Algorithms
Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
Faults and Recovery Ludovic Henrio INRIA - projet OASIS Sources: - A survey of rollback-recovery protocols in message-passing systems.
CS 582 / CMPE 481 Distributed Systems
Distributed Systems Fall 2009 Logical time, global states, and debugging.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Computer Science Lecture 17, page 1 CS677: Distributed OS Last Class: Fault Tolerance Basic concepts and failure models Failure masking using redundancy.
© nCode 2000 Title of Presentation goes here - go to Master Slide to edit - Slide 1 Reliable Communication for Highly Mobile Agents ECE 7995: Term Paper.
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.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Last Class: Weak Consistency
1 CS 194: Distributed Systems Distributed Commit, Recovery Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class:Consistency Semantics Consistency models –Data-centric consistency models –Client-centric.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
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.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Checkpointing and Recovery. Purpose Consider a long running application –Regularly checkpoint the application Expensive task –In case of failure, restore.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
A Survey of Rollback-Recovery Protocols in Message-Passing Systems.
EEC 688/788 Secure and Dependable Computing Lecture 7 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Fault Tolerant Systems
12. Recovery Study Meeting M1 Yuuki Horita 2004/5/14.
CS5204 – Operating Systems 1 Checkpointing-Recovery.
Checkpointing and Recovery. Purpose Consider a long running application –Regularly checkpoint the application Expensive task –In case of failure, restore.
CprE 545: Fault Tolerant Systems (G. Manimaran), Iowa State University1 CprE 545: Fault Tolerant Systems Rollback Recovery Protocols.
Coordinated Checkpointing Presented by Sarah Arnold 1.
Rollback-Recovery Protocols in Message-Passing Systems Based on A Survey of Rollback-Recovery Protocols in Message-Passing Systems by Mootaz Elnozahy Lorenzo.
Chapter 2 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University Building Dependable Distributed Systems.
Agenda Fail Stop Processors –Problem Definition –Implementation with reliable stable storage –Implementation without reliable stable storage Failure Detection.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
Fault Tolerance Chapter 7.
Fault Tolerance. Basic Concepts Availability The system is ready to work immediately Reliability The system can run continuously Safety When the system.
V1.7Fault Tolerance1. V1.7Fault Tolerance2 A characteristic of Distributed Systems is that they are tolerant of partial failures within the distributed.
Presentation-2 Group-A1 Professor:Mohamed Khalil Anita Kanuganti Hemanth Rao.
EEC 688/788 Secure and Dependable Computing Lecture 6 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Logical Clocks. Topics r Logical clocks r Totally-Ordered Multicasting.
Rollback-Recovery Protocols I Message Passing Systems Nabil S. Al Ramli.
Introduction to Fault Tolerance By Sahithi Podila.
Antidio Viguria Ann Krueger A Nonblocking Quorum Consensus Protocol for Replicated Data Divyakant Agrawal and Arthur J. Bernstein Paper Presentation: Dependable.
Fault Tolerance Chapter 7. Goal An important goal in distributed systems design is to construct the system in such a way that it can automatically recover.
Ludovic Henrio INRIA - projet OASIS
1 Fault Tolerance and Recovery Mostly taken from
Operating System Reliability Andy Wang COP 5611 Advanced Operating Systems.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Ludovic Henrio CNRS - projet SCALE
EEC 688/788 Secure and Dependable Computing
Operating System Reliability
Operating System Reliability
Lecture 9: Asynchronous Network Algorithms
EECS 498 Introduction to Distributed Systems Fall 2017
Outline Announcements Fault Tolerance.
Operating System Reliability
Operating System Reliability
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Operating System Reliability
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Abstractions for Fault Tolerance
Operating System Reliability
Operating System Reliability
Presentation transcript:

Faults and Recovery Ludovic Henrio CNRS - projet OASIS Sources: - A survey of rollback-recovery protocols in message-passing systems (Elnozahy, Alvisi, Wang and Johnson) - Distributed systems (Tanenbaum and Van Steen) Distributed Algorithms

Outline  Background  Generalities:  Faults, redundancy, stable storage  Recovery principles  Rollback-recovery protocols  Checkpointing protocols Coordinated vs. uncoordinated Communication induced checkpointing  message logging  Exercises

BACKGROUND: MODELLING DISTRIBUTED EXECUTIONS

4 Execution representation: time diagram  these execution are identical -> event representation  Only the order of message reception matters, whatever the transmission and execution duration Imaginary Time Axis P0 P1 P2 P0 P1 P2 P0 P1 P2 P0 P1 ≠

5 Happened-before relation:   When 2 events e1, e2,  Are local to a process Pi, e1  e2  e1: message send on Pi, e2: corresponding message reception on Pj, e1  e2  Several events, e1, e2, e3 (transitivity)  If e1  e2, and e2  e3, then, e1  e3  Not all events are mandatorily related along   Incomparable, independent, concurrent:  Non transitivity of ||  Happened-before relation: also named Causality (partial order) P2 P0 P1 e1 e2 e3 e2’ e1’ e1  e2 e1  e2’ e2  e3 e1  e3 e1’  e2’ e2’  e3 e1’  e3 e1 || e1’ e2 || e2’ || e1’ || e1 e2 || e1’ e2’ || e2

GENERALITIES ABOUT FAULTS AND RECOVERY

Failure Models  Different types of failures.  A system is k-fault tolerant if it can survive faults in k components and still meet its specification Type of failureDescription Crash failureA server halts, but is working correctly until it halts Omission failure Receive omission Send omission A server fails to respond to incoming requests A server fails to receive incoming messages A server fails to send messages Timing failureA server's response lies outside the specified time interval Response failure Value failure State transition failure The server's response is incorrect The value of the response is wrong The server deviates from the correct flow of control Arbitrary failureA server may produce arbitrary responses at arbitrary times

Failure Masking by Redundancy, an example tolerant to 1 fault  Triple modular redundancy.

Stable storage – a prerequisite for recovery  In a system that tolerates only a single failure, stable storage may consist of the volatile memory of another process  In a system that wishes to tolerate an arbitrary number of transient failures, stable storage may consist of a local disk in each host.  In a system that tolerates non-transient failures, stable storage must consist of a persistent medium outside the host on which a process is running. A replicated file system is a possible implementation in such systems

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

Cuts / consistent cuts strongly consistent cut A consistent cut in transit messages not consistent cut orphan message P0 P1 P2 P3

exercise  Find a few consistent cuts in the figure below (passing by )  Order the according to happened before  Characterise a consistent cut based on the happened before relation  How to characterize strongly consistent cuts? P0 P1 P2 P3

Recovery: Principles: strongly consistent cut checkpoint (stored local state) A recoverable state contains enough information to replay an execution up to a coherent cut of the original execution (up to the failure point) P0 P1 P2 P3 It is sufficient to reconstruct a state that could have occurred in a failure-free execution

Recovery: Principles: 1 - Checkpointing checkpoint (stored local state) Restart all, or almost all, processes from a consistent cut and let a new execution run P0 P1 P2 P3

Recovery: Principles: 2 – Message Logging checkpoint (stored local state) Only one (or a few) process recover and use message information to replay the previous execution until reaching the failure point P0 P1 P2 P3

In transit messages  If message delivery is not guaranteed, they are not a problem!  But if the communication protocol is reliable, they must be taken into account ➡ We have to store them (they are part of the recoverable state) in transit messages P0 P1 P2 P3

Orphan messages  If P2 fails and restarts from the cut, the message will be re-emitted and received twice by P1  Either avoid using inconsistent cuts (in general for checkpointing)  Or avoid re-emitting the message (in general for message logging) and replay the same execution not consistent cut orphan message P0 P1 P2 P3

RECOVERY: CHECKPOINTING MECHANISMS

Checkpoint-based rollback recovery – Uncoordinated checkpointing  Hypothesis: Fail stop  Each process takes checkpoints from time to time  Upon failure we compute the recovery line  A process (eg the failed one after a new machine has been restarted) initiates the process  Collects dependencies information from all the processes  Computes the recovery line and triggers recovery

Example: exercise 1 The algorithm used to compute the recovery line first marks the graph nodes corresponding to the states of processes P0 and P1 at the failure point (red ellipses). It then uses reachability analysis to mark all reachable nodes from any of the initially marked nodes. The union of the last unmarked nodes over the entire system forms the recovery line,

Example: exercise build the rollback dependency graph 2 – What is the recovery line? 3 – What if P3 fails instead?

Exercise 1 contd  Same exercise  How can you extend the rules in order to also avoid in-transit message?  What is the new recovery line? P0 P1 P2 P3

Exercise 1 contd: the domino effect  Find the recovery line Conclusion: let us synchronize checkpoints !!!

Coordinated checkpointing  There is an initiator process for the checkpointing  Only one (or 2) checkpoint per process (always consistent)  large latency: processed blocked until checkpoint is finished inconsistency if communications are not blocked until the end of the checkpointing phase P0: initiator P1 P2 P3 checkpoint requests

Coordinated checkpointing (2)  Algorithm:  block communications while the protocol executes  An initiator takes a checkpoint and broadcasts a request message to all processes  When a process receives this message, it  stops its execution,  flushes all the communication channels,  takes a tentative checkpoint, and  sends an acknowledgment message back  the coordinator receives acknowledgments from all processes, and broadcasts a commit message  After receiving the commit each process removes the old checkpoint, the new one becomes permanent

Coordintated Checkpointing (3) Overall execution graph P0: initiator P1 P2 P3 checkpoint requests acknowledgments Commit

Solutions to avoid blocked states  if communication channels are FIFO: propagate the checkpoint request before sending any other message  Or piggyback checkpoint request on first message => take the checkpoint before taking the message into account Question: is FIFO necessary when piggybacking?

28 Another version: Distributed Snapshot algo for FIFO channels [Chandy-Lamport]  Channels are FIFO. Messages are not lost.  Snapshot algo. executes concurrently with the application  Special “control” message  When receiving it for the 1 st time through a channel:  Pi records its state, and channel state = empty  Pi forwards control message to all its outgoing neighbors  Messages received through the other incoming channels after a 1 st received “control” msg are logged  When not the 1 st time: Pi adds to its state all logged msgs that came from this channel so far  Any process may initiate the algo. at any time (triggers one control msg for itself), but concurrent execs must be distinguishable  Terminated: all Pi received control msg from all incoming channels  Logged msgs on P->Q, logged by Q=“msgs sent by P to Q while P and Q already logged their state, and Q waited the control msg from P” (m3 in the Ex.) R P Q Ex.: R P Q m1 m4 m3 m2 Sp Sr Sq Snapshot= {Sp,Sq,Sr,m3}

Exercise  Why is FIFO necessary for Chandy-Lamport algorithm? / How are orphan messages avoided?  What about in transit messages: how are they managed with Chandy Lamport algorithm?  Two processes P and Q are connected in a ring, they constantly rotate a message m (but might perform some lecal compuation before re-sending the msg). At any time, there is only one copy of m in the system. Each process’s state consists of the number of times it has received m, Psends first. At a certain point, P has the message and its state is 101. Immediately after sending m, P initiates the snapshot algorithm. Explain the operations of the algorithm in this case and give the possible global state(s) reported by it.

Communication Induced Checkpointing  2 kinds of checkpoints: local and forced  prevent the creation of useless checkpoints  no coordination message: only piggybacks information  Simplest = index-based:  processes piggyback timestamps (increasing timestamps for a given process)  For example [Briatico et al.] forces a checkpoint upon receiving a message with a greater index than the local index  A recovery line consists of checkpoints with the same index

Communication Induced Checkpointing (2) 1 1 P0 P1 P2 P <1: in transit messages 1 P2(at 0) receives 1: take a checkpoint before reception forced checkpoint a local checkpoint A consistent cut

Exercise  show that the domino effect of exercise 1 is not possible anymore: assign index to checkpoints, add forced checkpoints and give piggybacked indexes on messages (black boxes are the local checkpoints)  check with different failure points

exercise contd.  what to do if more than 1 number of difference between indices?  What does it mean when the piggybacked index is smaller than the current checkpoint? What can be done / can we use this information? P0 P1 P2 P3

Question  Suppose each process takes a local checkpoint regularly (e.g. every 10 minutes), the preceding protocol multiplies (forced) checkpoints, how to keep a linear number of checkpoints (forced+local)? (forced CP are blue ones) while having always a checkpoint (forced or local)

Note: using clocks  One could also use synchronized clocks to “synchronize” checkpoints: wait long enough to avoid possible clock deviation

In transit messages  Remember that if the communication protocol is reliable, they must be stored ➡ It is easy to store them with the next checkpoint of the message sender (sender-based) or reciever. ➡ Receiver-based: checkpoint already stored ➡ Sender-based: messages are sent again upon recovery Question: Can we optimize the recovery process and avoid re-sending in-transit messages to processes that have not failed? in transit messages P0 P1 P2 P3

RECOVERY: MESSAGE LOGGING MECHANISMS

Message Logging  Hypothesis: piecewise determinism = all non- deterministic events can be identified and their determinants can be stored on stable storage.  An execution is a sequence of deterministic events (replayed) and non-deterministic events (logged and simulated from log)  determinants of non-deterministic events are stored during failure-free execution  + checkpoints to avoid recovering from the start  Additional hypothesis: It is possible to prevent a message from being sent or received

Message Logging  A process is orphan if it depends on the execution of a non-logged non-deterministic event  Always no orphan process  Log(e) = set of processes locally storing the event e  Stable(e) if e’s determinant is logged on stable storage  Depend(e) processes affected by a non-deterministic event e else the process is said orphan

Tiny exercise  Question: what is depend(e) in the example below?  What about depend(e’) P0 P1 P2 P3 e’e’ e

Pessimistic message logging  orphan processes are never created but requires a lot of synchronizations with the stable storage  Logs the determinant of ND events before executing them P0 P1 P2 P3 logged message reception message resent during recovery (might have to be cancelled) Only 1 process restarts

Pessimistic message logging (2)  only the failed processes recover  simple  restart from last checkpoint, recovery simple and very fast  garbage collection simple  Easier to take into account outside world  performance penalty due to synchronous logging  NB: if message delivery is not guaranteed then logging does not have to be synchronous, it is only necessary to log a reception before sending the next message -> exercise

Optimistic message logging (principles)  Determinant kept locally, and sometimes stored on global storage  Track causal dependencies between messages  synchronous recovery: compute the maximum recoverable state  Asynchronous: trigger recovery of causally related processes during the recovery process  Risk of exponential rollbacks

Summary  In fault tolerance strong (interesting) results require strong assumptions, or a lot of redundancy and inefficiency  Fortunately in practice most system are reliable enough  What was not presented:  safe communications  details of optimistic message logging  causal logging  complex protocols in general  redundancy and basic coherence, safety algorithm (course placed on a higher protocol level)

Advantages and drawbacks of ML/CP (simplified!) Checkpointing Message logging small and medium size large scaleMedium or high Rather low Target systemOverhead

EXERCISES

Exercise: Improving pessimistic message logging  The performance overhead of pessimistic logging can be reduced by delivering a message or an event and deferring its logging until the receiver communicates with any other process,

Exercise: Improving optimistic message logging  Below, which messages have to be logged? when?  Can there be orphan processes?  What can happen at recovery?  Illustrate it on example and if P2 crashes:  What if P1 and P2 crashes “simultaneously” P0 P1 P2 P3

Exercise: Z-paths A Z-cycle is a Z-path that begins and ends with the same checkpoint. e.g. m5 m3 m4

Exercise: link between Z-paths and checkpoint dependencies 1 – draw the checkpoint dependency graph for the execution of the previous slide 2 – find Z-path in the executions mentioned in the course:

Equivalence?  Zpaths have been used to prove correctness of some CIC protocols, because a checkpoint in a Z-cycle is not useful: On the preceding examples, show that the checkpoints in Z-cycles would not be used upon recovery according to the checkpoint dependency graph NB: this is not a proof of equivalence!

For next week  Question: Explain why there is no domino effect in CIC protocols  PLUS exercise on the next 2 slides NB: the exercise is inspired by the following paper (only read it if you want to go a bit further) A Hybrid Message Logging-CIC Protocol for Constrained Checkpointability Francoise Baude, Denis Caromel, Christian Delbe, Ludovic Henrio - proceedings of Euro-Par 2005, Springer-Verlag sop.inria.fr/oasis/christian.delbe/publis/europar2005.pdfhttp://www- sop.inria.fr/oasis/christian.delbe/publis/europar2005.pdf

Additional exercise: an hybrid protocol  Supposing processes are split into different groups  We want to implement CIC inside a group, and pessimistic message logging between groups  Specify (i.e. write pseudo code for) an protocol that implements such an hybrid algorithm:  what happens when we send/receive a com  inside a group  between groups  when is a forced checkpoint taken  Specify the recovery mechanism (NB a whole group recovers)  Test it on the examples next slides (you can do the examples first and write the pseudo code after )

Additional exercise  execution example 2 groups x 3 processes  place forced messages?  which messages are logged?  what happens at recovery? P0 P1 P2 P’0P’0 P’1P’1 P’2P’2

Another example  Same questions P0 P1 P2 P’0P’0 P’1P’1 P’2P’2

AN HYBRID PROTOCOL

l Delayed checkpoints In-transit Messages Q1 I J Logged requests and replies Stable state 2 Request Service

I 3 3 J Q1 In-transit Messages (recovery) l Delayed checkpoints Resend Logged messages upon recovery

Orphan Requests Q1 I J 3

l Reception is removed from the checkpoint Requests removed from the Requests queue Orphan Requests Q1 I J

Orphan Requests (recovery) I 3 3 J Q1 l Orphan request is also received during recovery

l Replies cannot be removed from the internal state Orphan Replies R1 I J

l Replies resent during recovery must be ignored. l The protocol must guarantee that these replies are identical in the two executions. Orphan Replies (recovery) R1 I 3 3 J Equivalent execution

Equivalent Executions I 3 Q2 3 J 32 K R1 Q1 Serv(Q1)Serv(Q2)

Equivalent Executions I 3 Q2 3 J 3 K R1 BIS Q1 Serv(Q1)Serv(Q2) l repeated replies must be equal : Q1 must be served before Q2 sur J

Equivalent Executions I 3 Q2 3 J 3 K R1 BIS Q1 Serv(Q1) Serv(Q2) l Twice replies must be equal : Q1 must be served before Q2 sur J

Equivalent Executions (2) I 3 Q3 2 J 32 K Q1 Serv(Q2) 3 Q2 l Causal relations : Q1 must be received before Q3 on J

Equivalent Executions (2) I 3 Q3 J 3 K Q1 Serv(Q2) 3 l Causal relations : Q1 must be received before Q3 on J