Event Ordering Greg Bilodeau CS 5204 November 3, 2009.

Slides:



Advertisements
Similar presentations
Time, Clocks, and the Ordering of Events in a Distributed System
Advertisements

Chapter 12 Message Ordering. Causal Ordering A single message should not be overtaken by a sequence of messages Stronger than FIFO Example of FIFO but.
Logical Clocks (2).
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.
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.
Distributed Systems Spring 2009
Ordering and Consistent Cuts Presented By Biswanath Panda.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
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.
Lecture 13 Synchronization (cont). EECE 411: Design of Distributed Software Applications Logistics Last quiz Max: 69 / Median: 52 / Min: 24 In a box outside.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Time, Clocks and the Ordering of Events in a Distributed System - by Leslie Lamport.
EEC-681/781 Distributed Computing Systems Lecture 10 Wenbing Zhao Cleveland State University.
EEC-681/781 Distributed Computing Systems Lecture 10 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.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
Distributed Systems Foundations Lecture 1. Main Characteristics of Distributed Systems Independent processors, sites, processes Message passing No shared.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Logical Clocks and Global State.
Logical Clocks (2). Topics r Logical clocks r Totally-Ordered Multicasting r Vector timestamps.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chapter 5.
1DT066 D ISTRIBUTED I NFORMATION S YSTEM Time, Coordination and Agreement 1.
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.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Project Reference Some slides are in courtesy of Dr. Erciyes,
Distributed Mutex EE324 Lecture 11.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Logical Clocks n event ordering, happened-before relation (review) n logical clocks conditions n scalar clocks condition implementation limitation n vector.
Reliable Communication in the Presence of Failures Based on the paper by: Kenneth Birman and Thomas A. Joseph Cesar Talledo COEN 317 Fall 05.
Page 1 Logical Clocks Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is.
Logical Clocks. Topics Logical clocks Totally-Ordered Multicasting Vector timestamps.
Lamport’s Logical Clocks & Totally Ordered Multicasting.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Distributed Systems Fall 2010 Logical time, global states, and debugging.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
Distributed Coordination. Turing Award r The Turing Award is recognized as the Nobel Prize of computing r Earlier this term the 2013 Turing Award went.
CIS825 Lecture 2. Model Processors Communication medium.
9/14/20051 Time, Clocks, and the Ordering of Events in a Distributed System by L. Lamport CS 5204 Operating Systems Vladimir Glina Fall 2005.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
Logical Clocks. Topics Logical clocks Totally-Ordered Multicasting Vector timestamps.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
CS603 Clock Synchronization February 4, What is Clock Synchronization? All nodes agree on time What do we mean by time? –Monotonic –Any observation.
Distributed Systems Topic 5: Time, Coordination and Agreement
D ISTRIBUTED S YSTEM UNIT-2 Theoretical Foundation for Distributed Systems Prepared By: G.S.Mishra.
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.
Lecture 1: Logical and Physical Time with some Applications Anish Arora CSE 6333 Notes include material from Dr. Jeff Brumfield.
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.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
11-Jun-16CSE 542: Operating Systems1 Distributed systems Time, clocks, and the ordering of events in a distributed system Leslie Lamport. Communications.
Logical Clocks event ordering, happened-before relation (review) logical clocks conditions scalar clocks  condition  implementation  limitation vector.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Distributed Mutex EE324 Lecture 11.
COT 5611 Operating Systems Design Principles Spring 2012
Distributed Systems CS
Time And Global Clocks CMPT 431.
Event Ordering.
Outline Theoretical Foundations
Distributed Systems CS
Basics of Distributed Systems
Distributed Systems CS
CSE 542: Operating Systems
COT 5611 Operating Systems Design Principles Spring 2014
Presentation transcript:

Event Ordering Greg Bilodeau CS 5204 November 3, 2009

Event Ordering Fault Tolerance How do we prepare for rollback and recovery in a distributed system? How do we ensure the proper processing order of communications between distributed processes? CS 5204 – Fall, 2009

Event Ordering Time No shared clock All specifications of a system must be given in terms of events observable within that system Can we construct a concept of “time” that would be useful from events of a distributed system? CS 5204 – Fall, 2009

Event Ordering Events An event is just an event of interest – example: a communication between processes Single process defined as totally ordered sequence of events CS 5204 – Fall, 2009

Event Ordering Events “Happened before” relation  :  If a and b from same process and a comes before b  a is a send and b a receive from different processes  If a  b and b  c, then a  c  Events a and b concurrent if !a  b and !b  a CS 5204 – Fall, 2009

Event Ordering Events CS 5204 – Fall, 2009 Another definition: events causally affect each other a  b means it is possible for a to causally affect b a and b are concurrent if they cannot causally affect each other

Event Ordering Logical Clocks Assigns a number to an event Simple counter Clock Condition:  For a, b: if a  b then C(a) < C(b)  C(p 1 ) < C(p 2 )  C(p 1 ) < C(q 2 )  C1: Line between local events  C2: Line between send and receive CS 5204 – Fall, 2009

Event Ordering Logical Clocks How we meet these conditions: C1:  Each process increments its clock between successive events C2:  Requires each message to include a timestamp equal to time the message was sent  Receiver sets its own clock to a value greater than or equal to its own value and greater than the timestamp from the message – cannot move its clock backward CS 5204 – Fall, 2009

Event Ordering CS 5204 – Operating Systems 9 Example of Lamport’s Algorithm P1P1 P2P2 P3P

Event Ordering Lamport’s Approach Just order events according to “times” at which they occur If “times” are equal, choose one to proceed Example: mutual exclusion problem  Assume all messages received in order  Assume all messages eventually received  Each process has own request queue  Conditions we must achieve: Process with resource must release before used by others Requests must be granted in order made Every request must eventually be granted CS 5204 – Fall, 2009

Event Ordering Lamport’s Mutual Exclusion Example Process P i sends T m :P i message to all others, adds message to own request queue Process P j adds resource request to its queue, sends a time stamped acknowledgement When finished, P i removes the message from its queue, sends a time stamped removal to all others Process P j removes the resource request from the queue P i can use the resource when:  It’s own request is ordered before any others in its queue  It has received a message from all others stamped later than T m CS 5204 – Fall, 2009

Event Ordering Limits of Lamport Clock times cannot guarantee causal relationship  We can say if a  b then C(a) < C(b)  CANNOT say if C(a) < C(b) then a  b  Concept of “time” is exclusive to each process, i.e. causality only in same process We can provides this through:  Using physical clocks  Using vector clocks CS 5204 – Fall, 2009

Event Ordering Vector Time The vector time for p i, VT(p i ):  Length n, where n is number of processes in group  Initialized to all zeros  p i increments VT(p i )[i] when sending m  Each message sent in time-stamped with VT(p i )  Receiving processes in the group modify their vector clock:  Vector time-stamp of m counts the number of messages that causally precede m on a per-sender basis CS 5204 – Fall, 2009

Event Ordering CS 5204 – Operating Systems 14 Vector Clocks P2P2 P1P1 (1,0,0) (0,1,0) (3,4,1) (2,0,0) (2,4,1) (2,2,0) (2,3,1) P3P3 (0,0,2) (0,0,1)

Event Ordering Birman-Schiper-Stephenson ISIS toolkit – tools for building software in loosely coupled distributed environments CBCAST – multicast primitive  Fault-tolerant, causally ordered message delivery  Asynchronous ABCAST  Extension allowing total ordering  Synchronous Group communication Imposes overhead proportional to group size CS 5204 – Fall, 2009

Event Ordering Birman-Schiper-Stephenson Cooperative processes form groups Processes multicast to all members of their group(s) Delivery times are uncertain…possible to receive messages out of causal sequence Message processing mechanism must provide lossless, uncorrupted and sequenced delivery Distinction between “receiving” and “delivering”  Allows delay of delivery until some condition satisfied – i.e. causal order maintained CS 5204 – Fall, 2009

Event Ordering CS 5204 – Operating Systems 17 Causal Ordering of Messages P2P2 P1P1 Send(M 1 ) Send(M 2 ) P3P3   Space Time

Event Ordering Vector Clocks in BSS Values in vector clock indicate how many multicasts preceded message by each process; must process same number from each before same state is reached Recipient will delay delivery of the message using a delay queue until corresponding number of messages have been received CS 5204 – Fall, 2009

Event Ordering Conclusions Causal relationships between events of processes in a distributed environment are critical when discussing fault-tolerance and rollback/recovery Achieving total ordering of events is difficult in the absence of a shared clock Mechanisms to provide shared logical clocks use simple counters but can enforce causal orderings CS 5204 – Fall, 2009

Event Ordering Questions? CS 5204 – Fall, 2009