1 / 12

Chapter 9 Global Snapshot

Chapter 9 Global Snapshot. The mystery of the missing dollars. Picture taken at A - $400 A sends $100 to B Picture taken at B - $400 Total is $800. Send $100. B. A. $300. $400. Global Snapshot Problem. Determine the global system state (e.g. the total money )

jeneva
Download Presentation

Chapter 9 Global Snapshot

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. Chapter 9Global Snapshot

  2. The mystery of the missing dollars • Picture taken at A - $400 • A sends $100 to B • Picture taken at B - $400 • Total is $800 Send $100 B A $300 $400

  3. Global Snapshot Problem • Determine the global system state (e.g. the total money ) • Each process records its own state • No shared clock/memory • Group of photographers taking snaps of different portions and trying to combine to get the overall picture.

  4. Consistent cut • Given computation (E,!) and F µ E is a cut iff • F is a consistent cut (global snapshot) iff

  5. Consistent and inconsistent cuts

  6. Chandy and Lamport's Algorithm • Assumes • FIFO and • Unidirectional channels • A bidirectional channel is modelled as two unidirectional channels

  7. Chandy and Lamport's Algorithm • Each process has an associated color. All processes are initially white. • A process records it local state just before turning red • On turning red the process sends out a marker on all outgoing channels • On receiving a marker a white process turns red

  8. Classification of messages • w – white process • r – red process • E.g.. rw – sent by a red process, received by a white process

  9. publicclass RecvCamera extends Process implements Camera { . . . public RecvCamera(Linker initComm, CamUser app) { . . . for (int i = 0; i < N; i++) if (isNeighbor(i)) { closed[i] = false; chan[i] = new LinkedList(); } else closed[i] = true; } publicsynchronizedvoid globalState() { myColor = red; app.localState(); // record local State; sendToNeighbors("marker", myId); // send Markers } publicsynchronizedvoid handleMsg(Msg m, int src, String tag) { if (tag.equals("marker")) { if (myColor == white) globalState(); closed[src] = true; if (isDone()){ ----- Display channel state (transit messages) chan[] ---- } } else { // application message if ((myColor == red) && (!closed[src])) chan[src].add(m); app.handleMsg(m, src, tag); // give it to app } } boolean isDone() { if (myColor == white) returnfalse; for (int i = 0; i < N; i++) if (!closed[i]) returnfalse; returntrue; } } Algorithm

  10. Non FIFO channels • Include color in all outgoing messages • Each process counts the number of white messages received by it • Marker from i to j includes number of white messages sent by i to j

  11. Applications • Checkpointing • Provide fault tolerance in distributed systems • Distributed debugging

  12. Applications • Stable predicate B: Once B becomes true it remains true, i.e. B is stable iff • Stable predicate detection • Property of a global snapshot S* • If Si is the initial global state, Sf is the final global state B(S*) ) B(Sf) B(S*) ) B(Si) • Take repeated snapshots

More Related