1 / 60

Fault Tolerance Chapter – 7 (Distributed Systems)

Fault Tolerance Chapter – 7 (Distributed Systems). Mr. Imran Rao Ms. NiuYu 22 nd November 2005. Today ’ s Agenda. Overview Introduction to Fault Tolerance Process Resilience Reliable Client-Server communication Reliable group communication Distributed commit Recovery Summary.

Télécharger la présentation

Fault Tolerance Chapter – 7 (Distributed Systems)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fault ToleranceChapter – 7(Distributed Systems) Mr. Imran Rao Ms. NiuYu 22nd November 2005 Real Time Multimedia Lab

  2. Today’s Agenda • Overview • Introduction to Fault Tolerance • Process Resilience • Reliable Client-Server communication • Reliable group communication • Distributed commit • Recovery • Summary Real Time Multimedia Lab

  3. Objectives • After taking this presentation, one can • Define Fault Tolerance • Distinguish among different kinds of Faults • Apply Failure Masking Techniques • Process Resilience • Communication Failure Masking • What is Distributed Commit and Related Issues? • What are the Recovery Techniques? Real Time Multimedia Lab

  4. Overview • Introduction to Fault Tolerance • Basic Concepts • Failure Modes • Failure Masking • Process Resilience • Design Issues • Reliable Communication • P2P Communication • Client Server Communication (RPC, RMI) • Group Communication (Multicasting) • Distributed Commit • Multi Phase Commit (Two & Three Phase) • Recovery Techniques • Check Pointing, Message Logging Real Time Multimedia Lab

  5. Basic Concepts (1/3) • What is Failure? • System is said to be in failure state when it cannot meet its promise. • Why do Failure occurs? • Failures occurs because of the error state of the system. • What is the reason for Error? • The cause of an error is called a fault • Is there some thing ‘Partial Failure’? • Faults can be Prevented, Removed and Forecasted. • Can Faults be Tolerated by a system also? Real Time Multimedia Lab

  6. Basic Concepts (2/3) • What characteristics makes a system Fault Tolerant? • Availability: System is ready to used immediately. • Reliability: System can run continuously without failure. • Safety: Nothing catastrophic happens if a system temporarily fails. • Maintainability: How easy a failed system can be repaired. • Dependability: ??? • What is the reliability and availability of following systems? • If a system goes down for one millisecond every hour • If a System never crashes but is shut down for two weeks every August. Real Time Multimedia Lab

  7. Basic Concepts (3/3) • Classification of Faults • Transient: Occurs once and than disappears • Intermittent: Occurs, vanishes on its own accord, than reappears and so on • Permanent: They occurs and doesn’t vanish until fixed manually. • Can you classify the Faults caused by following situations? • A flying bird obstructing the transmitting waves signals • A loosely connected power plug • Burnt out chips • Software Bugs • Which Fault you think is more difficult to detect and why? Real Time Multimedia Lab

  8. Faults in Distributed Systems • If in a Distributed Systems some fault occurs, the error may by in any of • The collection of servers or • Communication Channel or • Even both • However, malfunctioning server itself may not always be the fault we are looking for. Why? • Dependency relations appear in abundance in DS. • Hence, we need to classify failures to know how serious a failure actually is. Real Time Multimedia Lab

  9. Failure Models Real Time Multimedia Lab

  10. Failure Masking by Redundancy (1/3) • A system to be fault tolerant, the best it can do is try to hide the occurrence of failure from other processes • Key technique to masking faults is to use Redundancy. • Information redundancy: Extra bits are added to allow recovery from garbled bits • Time redundancy: An action is performed, and then, if need be, it is performed again. • Physical redundancy: Extra equipment or processes are added • Issue: How much redundancy is needed? Real Time Multimedia Lab

  11. Failure Masking by Redundancy (2/3) • Some Examples of Redundancy Schemes • Hamming Code • Transactions • Replicated Processes or Components • Aircraft has four engines, can fly with only three • Sports game has extra referee. • Mammals. Can you point out How? Real Time Multimedia Lab

  12. Failure Masking by Redundancy (3/3) • Triple modular redundancy: • If two or three of the input are the same, the output is equal to that input. • If all three inputs are different, the output is undefined. Figure: Fault Tolerance in Electronic Circuits Real Time Multimedia Lab

  13. What's Next  • We have studied • What are Faults? • What are the characteristics of a fault tolerant system? • How to distinguish between different types of faults? • What are the failure models? • How Failures can be Masked? • What’s Next? • How Fault Tolerance is achieved in DS • How Process are made Resilient against Faults? Real Time Multimedia Lab

  14. Process Resilience • Problem: • How fault tolerance in distributed system is achieved, especially against Process Failures? • Solution: • Replicating processes into groups. • Groups are analogous to Social Organizations. • Consider collections of process as a single abstraction • All members of the group receive the same message, if one process fails, the others can take over for it. • Process groups are dynamic and a Process can be member of several groups. • Hence we need some management scheme for groups. Real Time Multimedia Lab

  15. Process Groups (1/2) Flat Group vs. Hierarchical Group • Flat Group • Advantage: Symmetrical and has no single point failure • Disadvantage: Decision making is more complicated.  Voting • Hierarchical Group • Advantage: Make decision without bothering others • Disadvantage: Lost coordinator  Entire group halts Real Time Multimedia Lab

  16. Process Groups (2/2) Group Membership • Group Server (Client Server Model) • Straight forward, simple and easy to implement • Major disadvantage  Single point of failure • Distributed Approach (P2P Model) • Broadcast message to join and leave the group • In case of fault, how to identify between a really dead and a dead slow member • Joining and Leaving must be synchronized  on joining send all previous messages to the new member • Another issue is how to create a new group? Real Time Multimedia Lab

  17. Failure Masking & Replication • Replicate Process and organize them into groups • Replace a single vulnerable process with the whole fault tolerant Group • A system is said to be K fault tolerant if it can survive faults in Kcomponents and still meet its specifications. • How much replication is needed to support K Fault Tolerance? • K+1 or 2K+1 ? • Case: • If K processes stop, then the answer from the other one can be used. K+1 • If meet Byzantine failure, the number is 2K+1  Problem? Real Time Multimedia Lab

  18. Agreement in Faulty Systems • Why we need Agreements? • Goal of Agreement • Make all the non-faulty processes reach consensus on some issue • Establish that consensus within a finite number of steps. • Problems of two cases • Good process, but unreliable communication • Example: Two-army problem • Good communication, but crashed process • Example: Byzantine generals problem Real Time Multimedia Lab

  19. Two-army problem 5000 Red Troop 1. Let us attack at 6 AM. 2. Ok, that is good. 4. I knew that you got my message. 3. I got your message. Attack Attack 3000 3000 Blue Troop Command by Alexander Blue Troop Command by Napoleon  It is easy to show that Alexander and Napoleon will never reach agreement, no matter how many acknowledgements they send. (Due to unreliable communication). Real Time Multimedia Lab

  20. Byzantine generals problem The Byzantine generals problem for 3 loyal generals and1 traitor. • The generals announce their troop strengths (in units of 1 thousand soldiers). • The vectors that each general assembles based on (a) • The vectors that each general receives in step 3. Real Time Multimedia Lab

  21. Go forward one more step The same as in previous slide, except now with 2 loyal generals and one traitor. More than two-thirds  agreement Lamport proved that in a system with m faulty processes, agreement can be achieved only if 2m+1 correctly functioning processes are present, for a total of 3m+1. Real Time Multimedia Lab

  22. Reliable client-server communication • TCP masks omission failures • … by using ACKs & retransmissions • … but it does not mask crash failures ! • E.g.: When a connection is broken, the client is only notified via an exception What about reliable point-to-point transport protocols ? Real Time Multimedia Lab

  23. Five classes of failures in RPC • Client is unable to locate server • Binding exception • … at the expense of transparency • Request message is lost • Is it safe to retransmit ? • Allow server to detect it is dealing with a retry • Server crashes after receiving a request • Reply message is lost • Client crashes after sending a request Real Time Multimedia Lab

  24. Server Crashes (I) A server in client-server communication • Normal case • Crash after execution • Crash before execution Real Time Multimedia Lab

  25. Server Crashes (II) • At-least-once semantics • Client keeps retransmitting until it gets a response • At-most-once semantics • Give up immediately & report failure • Guarantee nothing • Ideal would be exactly-once semantics • … no general way to arrange this ! Real Time Multimedia Lab

  26. Server Crashes (III) • Print server scenario: • M: server’s completion message • Server may send M either before or after printing • P: server’s print operation • C: server’s crash • Possible event orderings: • M  P  C • M  C ( P) • P  M  C • P  C ( M) • C ( P  M) • C ( M  P) Real Time Multimedia Lab

  27. Server Crashes (IV) Different combinations of client & server strategies in the presence of server crashes. No combination of client & server strategy is correct for all cases ! Real Time Multimedia Lab

  28. Lost Reply Messages • Is it safe to retransmit the request ? • Idempotent requests • Example: Read a file’s first 1024 bytes • Counterexample: money transfer order • Assign sequence number to request • Server keeps track of client’s most recently received sequence # • … additionally, set a RETRANSMISSION bit in the request header Real Time Multimedia Lab

  29. Client Crashes (I) • Orphan computation: • No process waiting for the result • Waste of resources (CPU cycles, locks) • Possible confusion upon client’s recovery • 4 alternative strategies proposed by Nelson (1981) • Extermination: • Client keeps log of requests to be issued • Upon recovery, explicitly kill orphans • Overhead of logging (for every RPC) • Problems with grand-orphans • Problems with network partitions Real Time Multimedia Lab

  30. Client Crashes (II) • Reincarnation: • Divide time up into epochs (sequentially numbered) • Upon reboot, client broadcasts start-of-epoch • Upon receipt, all remote computations on behalf of this client are killed • After a network partition, an orphan’s response will contain an obsolete epoch number  easily detected • Gentle reincarnation: • Upon receipt of start-of-epoch, each server checks to see if it has any remote computations • If the owner cannot be found, the computation is killed • Expiration: • Each RPC is given a time quantum T to complete • … must explicitly ask for another if it cannot finish in time • After reboot, client only needs to wait a time T … • How to select a reasonable value for T ? Real Time Multimedia Lab

  31. Agenda Introduction to Fault Tolerance Process Resilience Reliable Client-Server communication Reliable group communication Distributed commit Recovery Summary Real Time Multimedia Lab

  32. Basic Reliable-Multicasting Schemes A simple solution to reliable multicasting when all receivers are known & are assumed not to fail • Message transmission • Reporting feedback Real Time Multimedia Lab

  33. Scalability in Reliable Multicasting • The scheme described above can not support large numbers of receivers . • Reason:  Feedback Implosion  Receivers are spread across a wide-area network • Solution: Reduce the number of feedback messages that are returned to the sender. • Model: Feedback suppression Real Time Multimedia Lab

  34. Nonhierarchical Feedback Control Several receivers have scheduled a request for retransmission, but the first retransmission request leads to the suppression of others. Real Time Multimedia Lab

  35. Hierarchical Feedback Control The essence of hierarchical reliable multicasting: • Each coordinator forwards the message to its children. • A coordinator handles retransmission requests. Real Time Multimedia Lab

  36. Atomic Multicast • We need to achieve reliable multicasting in the presence of process failures. • Atomic multicast problem: a message is delivered to either all processors or to none at all all messages are delivered in the same order to all processes • Virtually synchronous reliable multicasting offering totally-ordered delivery of messages is called atomic multicasting Real Time Multimedia Lab

  37. Virtual Synchrony (I) The logical organization of a distributed system to distinguish between message receipt and message delivery Real Time Multimedia Lab

  38. Virtual Synchrony (II) • Reliable multicast guarantees that a message multicast to group view G is delivered to each nonfaulty process in G. • If the sender of the message crashes during the multicast, the message may either be delivered to all remaining processes, or ignored by each of them. • A reliable multicast with this property is said to be virtually synchronous • All multicasts take place between view changes. A view change acts as a barrier across which no multicast can pass Real Time Multimedia Lab

  39. Virtual Synchrony (III) The principle of virtual synchronous multicast. Real Time Multimedia Lab

  40. Implementing Virtual Synchrony • Process 4 notices that process 7 has crashed, sends a view change • Process 6 sends out all its unstable messages, followed by a flush message • Process 6 installs the new view when it has received a flush message from everyone else Real Time Multimedia Lab

  41. Message Ordering (I) 1. Unordered multicast 2. FIFO-ordered multicast Real Time Multimedia Lab

  42. Message Ordering (II) • Reliable causally-ordered multicast delivers messages so that potential causality between different messages is preserved • Total-ordered delivery Real Time Multimedia Lab

  43. Agenda Introduction to Fault Tolerance Process Resilience Reliable Client-Server communication Reliable group communication Distributed commit Recovery Summary Real Time Multimedia Lab

  44. Two-phase Commit (I) • The finite state machine for the coordinator in 2PC. • The finite state machine for a participant. • Process crashes  other processes may be indefinite waiting for a message  This protocol can easily fail •  timeout mechanisms are used Real Time Multimedia Lab

  45. Failure handling in 2PC • Participant times out waiting for coordinator’s Request-to-prepare • It decide to abort. • Coordinator times out waiting for a participant’s vote • It decides to abort. • A participant that voted Prepared times out waiting for the coordinator’s decision • It’s blocked. • Use a termination protocol to decide what to do. • Native termination protocol – wait until coordinator recovers. • The coordinator times out waiting for ACK message • It must resolicit them, so it can forget the decision Real Time Multimedia Lab

  46. Actions by coordinator while START _2PC to local log;multicast VOTE_REQUEST to all participants;while not all votes have been collected { wait for any incoming vote; if timeout { while GLOBAL_ABORT to local log; multicast GLOBAL_ABORT to all participants; exit; } record vote;}if all participants sent VOTE_COMMIT and coordinator votes COMMIT{ write GLOBAL_COMMIT to local log; multicast GLOBAL_COMMIT to all participants;} else { write GLOBAL_ABORT to local log; multicast GLOBAL_ABORT to all participants;} Real Time Multimedia Lab

  47. Actions by participant write INIT to local log;wait for VOTE_REQUEST from coordinator;if timeout { write VOTE_ABORT to local log; exit;}if participant votes COMMIT { write VOTE_COMMIT to local log; send VOTE_COMMIT to coordinator; wait for DECISION from coordinator; if timeout { multicast DECISION_REQUEST to other participants; wait until DECISION is received; /* remain blocked */ write DECISION to local log; } if DECISION == GLOBAL_COMMIT write GLOBAL_COMMIT to local log; else if DECISION == GLOBAL_ABORT write GLOBAL_ABORT to local log;} else { write VOTE_ABORT to local log; send VOTE ABORT to coordinator;} Real Time Multimedia Lab

  48. 3 Phase Commit Protocol (I) • Problem of 2PC • In some cases, participants cannot reach a final decision • What case? • Solution • No single state from which to make a transition to either COMMIT or ABORT. • No state in which not possible to make a final decision and from which a transition to COMMIT can be made Real Time Multimedia Lab

  49. Three-phase Commit Protocol (II) • Introduction of another Phase • Finite state machine for the coordinator in 3PC • Finite state machine for a participant Real Time Multimedia Lab

  50. Failure handling in 3PC (I) • Coordinator Timeout/Recovery • Coordinator • WAIT: timeout • > ABORT • PRECOMMIT: timeout • > COMMIT • Recovering participant? Real Time Multimedia Lab

More Related