Ordering and Consistent Cuts Presented By Biswanath Panda.

Slides:



Advertisements
Similar presentations
Global States.
Advertisements

Distributed Snapshots: Determining Global States of Distributed Systems Joshua Eberhardt Research Paper: Kanianthra Mani Chandy and Leslie Lamport.
Global States in a Distributed System By John Kor and Yvonne Cheng.
Virtual Time “Virtual Time and Global States of Distributed Systems” Friedmann Mattern, 1989 The Model: An asynchronous distributed system = a set of processes.
SES Algorithm SES: Schiper-Eggli-Sandoz Algorithm. No need for broadcast messages. Each process maintains a vector V_P of size N - 1, N the number of processes.
Uncoordinated Checkpointing The Global State Recording Algorithm Cristian Solano.
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.
CS542 Topics in Distributed Systems Diganta Goswami.
Distributed Computing 5. Snapshot Shmuel Zaks ©
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Logical Clocks and Global State.
Distributed Systems Dinesh Bhat - Advanced Systems (Some slides from 2009 class) CS 6410 – Fall 2010 Time Clocks and Ordering of events Distributed Snapshots.
S NAPSHOT A LGORITHM. W HAT IS A S NAPSHOT - INTUITION Given a system of processors and communication channels between them, we want each processor to.
CS514: Intermediate Course in Operating Systems Professor Ken Birman Vivek Vishnumurthy: TA.
CS 582 / CMPE 481 Distributed Systems
Causality & Global States. P1 P2 P Physical Time 4 6 Include(obj1 ) obj1.method() P2 has obj1 Causality violation occurs when order.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
Distributed Systems Fall 2009 Logical time, global states, and debugging.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Ordering and Consistent Cuts
20101 Synchronization in distributed systems A collection of independent computers that appears to its users as a single coherent system.
Lecture 13 Synchronization (cont). EECE 411: Design of Distributed Software Applications Logistics Last quiz Max: 69 / Median: 52 / Min: 24 In a box outside.
Ordering and Consistent Cuts Presented by Chi H. Ho.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms CS 249 Project Fall 2005 Wing Wong.
Global Predicate Detection and Event Ordering. Our Problem To compute predicates over the state of a distributed application.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Logical Clocks and Global State.
Chapter 17 Theoretical Issues in Distributed Systems
Chapter 5.
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.
1 Distributed Systems CS 425 / CSE 424 / ECE 428 Global Snapshots Reading: Sections 11.5 (4 th ed), 14.5 (5 th ed)  2010, I. Gupta, K. Nahrtstedt, S.
Distributed Computing 5. Snapshot Shmuel Zaks ©
1 Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms Author: Ozalp Babaoglu and Keith Marzullo Distributed Systems: 526.
Lamport’s Logical Clocks & Totally Ordered Multicasting.
“Virtual Time and Global States of Distributed Systems”
Distributed Systems Fall 2010 Logical time, global states, and debugging.
Event Ordering Greg Bilodeau CS 5204 November 3, 2009.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
CIS825 Lecture 2. Model Processors Communication medium.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 5 Instructor: Haifeng YU.
Feb 15, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements.
Logical Clocks. Topics r Logical clocks r Totally-Ordered Multicasting.
Event Ordering. CS 5204 – Operating Systems2 Time and Ordering The two critical differences between centralized and distributed systems are: absence of.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
CS533 Concepts of Operating Systems Class 8 Time, Clocks, and the Ordering of Events in a Distributed System By Constantia Tryman.
CSE 486/586 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
1 Chapter 11 Global Properties (Distributed Termination)
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Efficient Algorithms for Distributed Snapshots and Global Virtual Time Approximation Author: Friedermann Mattern Presented By: Shruthi Koundinya.
11-Jun-16CSE 542: Operating Systems1 Distributed systems Time, clocks, and the ordering of events in a distributed system Leslie Lamport. Communications.
Distributed Systems Lecture 6 Global states and snapshots 1.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Vector Clocks and Distributed Snapshots
Theoretical Foundations
COT 5611 Operating Systems Design Principles Spring 2012
Logical Clocks and Casual Ordering
Outline Theoretical Foundations - continued Lab 1
Time And Global Clocks CMPT 431.
Chapter 5 (through section 5.4)
Slides for Chapter 11: Time and Global State
Lecture 8 Processes and events Local and global states Time
Jenhui Chen Office number:
Distributed algorithms
CIS825 Lecture 5 1.
COT 5611 Operating Systems Design Principles Spring 2014
Presentation transcript:

Ordering and Consistent Cuts Presented By Biswanath Panda

Introduction Ordering and global state detection in a “distributed system” Fundamental Questions  What is a distributed system?  What is a distributed computation?  How can we represent a distributed system?  Why are today’s papers so important?

A distributed system is …. A collection of sequential processes p 1, p 2, p 3 …..p n Network capable of implementing communication channels between pairs of processes for message exchange Channels are reliable but may deliver messages out of order Every process can communicate with every other process(may not be directly) There is no reasoning based on global clocks All kinds of synchronization must be done by message passing

Distributed Computation A distributed computation is a single execution of a distributed program by a collection of processes. Each sequential process generates a sequence of events that are either internal events, or communication events The local history of process p i during a computation is a (possibly infinite) sequence of events h i = e i 1, e i 2 ….... A partial local history of a process is a prefix of the local history h i n = e i 1, e i 2 … e i n The global history of a computation is the set H = U i=1 n h i

So what does this global history as defined tell us? It is just the collection of events that have occurred in the system It does not give us any idea about the relative times between the events As there is no notion of global time, events can only be ordered based on a notion of cause and effect So lets formalize this idea

Happened Before Relation (→) If a and b are events in the same process then a → b If a is the sending of a message m by a process and b is the corresponding receive event then a → b Finally if a → b b → c then a → c If a → b and b → a then a and b are concurrent → defines a partial order on the set H

Space Time Diagram Graphical representation of a distributed system If there is a path between two events then they are related Else they are concurrent

Is this notion of ordering really important? Some idea of ordering of events is fundamental to reason about how a system works Global State Detection is a fundamental problem in distributed computing  Enables detecting stable properties of a system  How do we get a snapshot of the system when there is no notion of global time or shared memory  How do we ensure that that the state collected is consistent Use this problem to illustrate the importance of ordering This will also give us the notion of what is a consistent global state

Global States and Cuts Global State is a n-tuple of local states one for each process Cut is a subset of the global history that contains an initial prefix of each local state Therefore every cut is a natural global state Intuitively a cut partitions the space time diagram along the time axis A Cut is identified by the last event of each process that is part of the cut

Example of a Cut

Introduction to consistency Consider this solution for the common problem of deadlock detection System has 3 processes p1, p2, p3 An external process p0 sends a message to each process (Active Monitoring) Each process on getting this message reports its local state Note that this global state thus collected at p 0 is a cut p 0 uses this information to create a wait for graph

Consider the space time diagram below and the cut C Cycle formed

So what went wrong? p 0 detected a cycle when there was no deadlock State recorded contained a message received by p3 which p1 never sent The system could never be in such a state and hence the state p0 saw was inconsistent So we need to make sure that application see consistent states

So what is a consistent global state? A cut C is consistent if for all events e and e’ Intuitively if an event is part of a cut then all events that happened before it must also be part of the cut A consistent cut defines a consistent global state Notion of ordering is needed after all !!

Passive Deadlock Detection Let’s change our approach to deadlock detection p 0 now monitors the system passively  Each process sends p 0 a message when an event occurs What global state does p 0 now see Basically hell breaks lose

FIFO Channels Communication channels need not preserve message order Therefore p 0 can construct any permutation of events as a global state Some of these may not even be valid (events of the same process may not be in order) Implement FIFO channels using sequence numbers Now we know that we p 0 sees constructs valid runs But the issue of consistency still remains

Ok let’s now fix consistency Assume a global real-time clock and bound of δ on the message delay Don’t panic we shall get rid of this assumption soon RC(e): Time when event e occurs Each process reports to p 0 the global timestamp along with the event Delivery Rule at p 0 : At time t, deliver all received messages upto t- δ in increasing timestamp order So do we have a consistent state now?

Clock Condition Yes we do!! e is observed before e’ iff RC(e) < RC(e’) Recall our definition of consistency Therefore state is consistent iff This is the clock condition For timestamps from a global clock this is obviously true Can we satisfy it for asynchronous systems?

Logical Clocks Turns out that the clock condition can be satisfied in asynchronous systems as well → is defined such that Clock Condition holds if  A and b are events of the same process and a comes before b then RC(a)<RC(b)  If a is the send of an event and b is corrsponding receive then RC(a)<RC(b)

Lamport’s Clocks Local variable LC in every process LC: Kind of a logical clock Simple counter that assigns timestamps to events Every send event is time stamped LC modification rules LC(e i ) = LC + 1 if e i is an internal event or send max{LC,TS(m)} + 1 if e i is receive(m)

Example of Logical Clocks p1 p2 p

Observations on Lamports Clocks Lamport says  a → b then C(a) < C(b) However  C(a) < C(b) then a → b ?? Solution: Vector Clocks  Clock (C) is a vector of length n  C[i] : Own logical time  C[j] : Best guess about j’s logical time

Vector Clocks Example 1,0,02,0,03,4,1 0,1,0 2,2,0 0,0,1 2,3,1 2,4,1

Let’s formalise the idea C[i] is incremented between successive local events On receiving message timestamped message m Can be shown that both sides of relation holds

So are Lamport clocks useful only for finding global state? Definitely not!!! Mutual Exclusion using Lamport clocks  Only one process can use resource at a time  Requests are granted in the order in which they are made  If every process releases the resource then every request is eventually granted  Assumptions FIFO reliable channels Direct connection between processes

Algorithm p1 p2 p3 1,1 (1,1) (1,1)(1,2) 1,2 (1,2) (1,1)(1,2) r4r3 p1 has higher time stamp messages from p2 and p3. It’s message is at top of queue. So p1 enters p1 sends release and now p2 enters

Algorithm Summary Requesting CS  Send timestamped REQUEST  Place request on request queue On receiving REQUEST  Put request on queue  Send back timestamped REPLY Enter CS if  Received larger timestamped REPLY  Request at the head of queue Releasing CS  Send RELEASE message  On receiving RELEASE remove request

Global State Revisited Earlier in the talk we had discussed the problem where a process actively tries to get the global state Solution to the problem that calculates only consistent global states Model  Process only knows about its internal events  Messages it sends and receives

Requirements Each process records it own local state The state of the communication channels is recorded All these small parts form a consistent whole State Detection must run along with underlying computation FIFO reliable channels

Global States

What exactly is channel state Let c be a channel from p to q p records its local state(Lp) and so does q(Lq) P has some sends in Lp whose receives may not be in Lq It is these sent messages that are the state of q Intuitively messages in transit when local states collected

Basic Algorithm Description p0 p1 p2 M B C A M B A C M Send A Send B Record State Send M Recv B Recv A Recv C Recv M, Record State, Channel (2,1)empty Recv M, Record State, Channel (0,1)empty, Send M Recv M, Record State, Channel (0,1)A Send C

Algorithm Summary Marker sending rule  P sends a marker on every outgoing channel after it records its state and before it sends further messages Marker receiving rule  If q has not recorded its state then begin q records its state; q records the state c as empty sequence end Else q records state of c as the messages it got along c after it had recorded its state till now

Comments on Algorithm Marker ensures liveness of algorithm Flooding Algorithm: O(n 2 ) messages Properties of the recorded global state So is such a state useful  Stable properties s1 s2 se

Conclusion We looked at  Fundamental concepts in distributed systems  Ordering in distributed systems  Global State Detection Papers are some of classic works in distributed systems Where theory meets practice!!!!