Overview of Ordering and Logical Time

Slides:



Advertisements
Similar presentations
Global States.
Advertisements

D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
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.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Time and Global States Chapter 11. Why time? Time is an Important and interesting issue in distributes systems. One we can measure accurately. Can use.
Ordering and Consistent Cuts
Lecture 13 Synchronization (cont). EECE 411: Design of Distributed Software Applications Logistics Last quiz Max: 69 / Median: 52 / Min: 24 In a box outside.
Logical Time and Logical Clocks
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.
Chapter 17 Theoretical Issues in Distributed Systems
Logical Clocks (2). Topics r Logical clocks r Totally-Ordered Multicasting r Vector timestamps.
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.
Logical Clocks n event ordering, happened-before relation (review) n logical clocks conditions n scalar clocks condition implementation limitation n vector.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS X.500 and LDAP.
Synchronization. Why we need synchronization? It is important that multiple processes do not access shared resources simultaneously. Synchronization in.
Logical Clocks. Topics Logical clocks Totally-Ordered Multicasting Vector timestamps.
Lamport’s Logical Clocks & Totally Ordered Multicasting.
“Virtual Time and Global States of Distributed Systems”
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.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
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.
CS603 Clock Synchronization February 4, What is Clock Synchronization? All nodes agree on time What do we mean by time? –Monotonic –Any observation.
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.
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.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Logical time Causality between events is fundamental to the design of parallel and distributed systems. In distributed systems, it is not possible to have.
CSC 8320 Advanced Operating System
SYNCHORNIZATION Logical Clocks.
Time and Clock Primary standard = rotation of earth
EECS 498 Introduction to Distributed Systems Fall 2017
Time and Clock.
COT 5611 Operating Systems Design Principles Spring 2012
Time and Clock.
Logical Clocks and Casual Ordering
Outline Theoretical Foundations - continued Lab 1
Time And Global Clocks CMPT 431.
Event Ordering.
Outline Theoretical Foundations
Chien-Liang Fok Distribution Seminar Chien-Liang Fok
CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
ITEC452 Distributed Computing Lecture 10 Time in a Distributed System
Chapter 5 (through section 5.4)
Basics of Distributed Systems
Lecture 8 Processes and events Local and global states Time
Outline Theoretical Foundations - continued
Chap 5 Distributed Coordination
Proof of liveness: an example
COT 5611 Operating Systems Design Principles Spring 2014
Last Class: Naming Name distribution: use hierarchies DNS
Outline Theoretical Foundations
Presentation transcript:

Overview of Ordering and Logical Time Prof. Dave Bakken Cpt. S 464/564 Lecture February 12, 2018 CptS 464/564 Fall 2011

This material is NOT in CDKB5 textbook Context This material is NOT in CDKB5 textbook Rather, from second text by Verissimo and Rodrigues, chapters 1.4 & 2.7 Do read the pertinent sections in CKDB5 Chapter 14, however! CptS 464/564 Fall 2011

Outline Logical Time Global States DS Properties CptS 464/564 Fall 2011

Logical Time Time in Distributed Systems Logical Time Computers can only be synchronized by network messages, but the latency can vary We can not synchronize enough to be able to, in general, tell the ordering of two arbitrary events at different computers. We can, however, establish an ordering on some of the events, and this can be used in many situations. Logical Time Builds up a notion of what we can reason about w.r.t. the order of events Defines the “Happened-before” relation Source: Lamport, Leslie. “Time, Clocks and the Ordering of Event in a Distributed System”, Communications of the ACM, Vol. 21, July 1978, pp. 558-565. One of the seminal works in distributed systems… Assigned for 564 students to read (see web page) CptS 464/564 Fall 2011

Happened-Before Relation Happened-Before relation, , based on observations: If two events occur in the same process, then they occurred in the order in which that process observes them. The receipt of a message happens after its being sent. “Happened-before” is transitive Corresponding Rules for events x, y, z, process p, and message m HB1: x –p – > y, then x  y HB2: send(m)  recv(m) Transitivity: x  y and y  z, then x  z Concurrency: If a ~ b and b ~ a, then a||b (“a is concurrent with b”)’ Note: if x  y (“x happened before y”) then y  x (“y happened after x”), notationally CptS 464/564 Fall 2011

Representing Distributed Computations Events at a process can be execution events: internal computations send events: sending a message to another process receive events: receiving a message from another process Message exchanges depicted with timelines: e.g. a b p1 c p2 m p3 e d CptS 464/564 Fall 2011

Happened-Before Example j a b h p1 m1 m3 c d i p2 physical time m2 e f g p3 Example table of , , || Limitations of Happened-Before Covert channels Too pessimistic: some things ab did not have a causing b! Happened-before also called Causal ordering Potential causality Lamport ordering (irreflexive) partial ordering CptS 464/564 Fall 2011

Logical Clocks How to implement “Happened Before”?? Logical Clock, a monotonically increasing counter. Let Each process p keeps its own logical clock, Cp, which it uses to timestamp events Cp (a) is the logical time at process p at which event a occurred C(a) is the logical time at which event a occurred at the process it occurred at Processes keep their own logical clocks, initialized to 0. Updated by rules: LC1: Before each event occurs, increment Cp LC2: When a process p sends a message m, it piggybacks on m value t= Cp When process q receives <m,t>, q computes Cq = max(Cq,t) + 1 then timestamps m CptS 464/564 Fall 2011

Logical Clock Example Note if a  b then LC(a) < LC(b) j a b k p1 1 2 3 7 m1 c d i p2 physical time 3 4 5 m2 e f g p3 1 5 6 Note if a  b then LC(a) < LC(b) However, LC(a) < LC(b) does not imply a  b Above, C(e) < C(b) yet b || e Also note that concurrency is not transitive: a||e and e||b yet ab CptS 464/564 Fall 2011

Logical Time & Clocks from 2003 Midterm P1 P2 P3 a c g b e f i d h j k a b c d e f g h i j k — ||   [22 points] On the diagram above, write the Logical Clock (LC) time at its processor for each event to the left of the dot for that event. [45 points] Fill out the empty cells in the table to give the relations between each event: “” denotes “happened before”, “” denotes “happened after”, and “||” denotes “concurrent”. (For examples of this notation, because there is a message from ‘a’ to ‘d’, it is filled in “” in the [a,d] cell and “” in the [d,a] cell. Also, ‘b’ and ‘a’ are concurrent, and are so marked.) CptS 464/564 Fall 2011

Global States Sometimes very useful to get a global “picture” of a distributed system Global state (GS) of a DS at any point is a vector of its individual process states: S = {S1, S2, …, SM} Two viewpoints of how a system evolves: Interleaving view: system goes through a succession of states (like above) Space-time view: system goes through a partially ordered set of events occuring in several processes in the system A cut (in space-time view) is a segment intersecting the timelines of all processes. A cut involves coordination with computers across a DS Many different ways to implement a cut in a DS that provide a range of properties and costs CptS 464/564 Fall 2011

Strongly consistent cut (SCC) Global States (cont.) Inconsistent cut (IC) Snapshot gives invalid picture of the DS (a state that could never happen) Example: message received but not sent in the snapshot Consistent cut (CC) Snapshot gives correct (state that could have happened) but possibly incomplete picture of the DS Example: messages in transit not accounted for in a snapshot Strongly consistent cut (SCC) Snapshot is a faithful representation of an actual global state of the DS No messages in transit when state read at each node, atomic checkpoints taken in that interval across nodes, … Note: TvS Chap6 has lots on consistency; we may cover some later in this class… CptS 464/564 Fall 2011

Example Cuts for Global States CC SCC IC p1 p2 p3 p4 m3 m1 m2 m4 Strongly consistent cut (SCC): faithfully represents GS of the system Inconsistent cut (IC): gives invalid picture of any GS Consistent cut (CC): gives valid but possibly incomplete picture of the GS of the system CptS 464/564 Fall 2011

DS Properties Goal: specify a system with high-level properties Safety properties: something bad (wrong events) never take place Specification: predicate P will never be true in the DS Liveness properties: something good (positive event) eventually takes place Specification: predicate P will eventually be true in the DS “any delivered message is delivered to all correct participants”: safety property (atomicity) “any message sent is delivered to at least one participant”: liveness property Timeliness properties specify a time that a predicate will be true in the DS at a given instant in time CptS 464/564 Fall 2011

Examples of DS Properties (aux) CptS 464/564 Fall 2011