7- global_states - CSE 486/586 Distributed Systems Global...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Global Snapshots Steve Ko Computer Sciences and Engineering University at Buffalo
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CSE 486/586, Spring 2012 Last Time Ordering of events Many applications need it, e.g., collaborative editing, distributed storage, etc. Logical time Lamport clock: single counter Vector clock: one counter per process Happens-before relation shows causality of events (causal ordering) 2
Image of page 2
CSE 486/586, Spring 2012 Today’s Question Distributed debugging How do you debug this? Log in to one machine and see what happens Collect logs and see what happens Taking a global snapshot ! 3 P0 P1 P2 Deadlock! Both waiting…
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CSE 486/586, Spring 2012 Today’s Question What’s the whole system’s global state at this point? Global state: a collection of local process states Can we evaluate a stable predicate ? Predicate : a function: (a global state)  {true, false} Stable predicate : once it’s true, it stays true the rest of the execution, e.g., a deadlock. 4 P1 P2 P3 e1 0 e11 e1 2 e1 3 e2 0 e2 1 e2 2 e3 0 e3 1 e3 2
Image of page 4
CSE 486/586, Spring 2012 Obvious First Try Synchronize clocks of all processes Ask all processes to record their states at known time t Problems? Time synchronization possible only approximately Another issue? Does not record the state of messages in the channels Again: synchronization not required – causality is enough! What we need: logical global snapshot The state of each process Messages in transit in all communication channels 5 P0 P1 P2 msg
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CSE 486/586, Spring 2012 How to Do It? Definitions For a process Pi , where events ei0, ei1, … occur, history(Pi) = hi = <ei0, ei1, … > prefix history(Pik) = hik = <ei0, ei1, …,eik > Sik : Pi ’s state immediately after kth event For a set of processes P1 , …, Pi , …. : Global history: H = i (hi) Global state: S = i (Siki) A cut C  H = h1c1  h2c2  …  hncn The frontier of C = {eici, i = 1,2, … n} 6 P1 P2 P3 e1 0 e11 e1 2 e1 3 e2 0 e2 1 e2 2 e3 0 e3 1 e3 2
Image of page 6
CSE 486/586, Spring 2012 Consistent States A cut C is consistent if and only if e  C (if f  e then f  C) A global state S is consistent if and only if it corresponds to a consistent cut 7 P1 P2 P3 e1 0 e11 e1 2 e1 3 e2 0 e2 1 e2 2 e3 0 e3 1 e3 2 Inconsistent cut Consistent cut
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CSE 486/586, Spring 2012 Why Consistent States? #1: For each event, you can trace back the causality. #2: Back to the state machine (from the last lecture) The execution of a distributed system as a series of transitions between global states: S0  S1  S2  … …where each transition happens with one single action from a process (i.e., local process event, send, and receive)
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern