Causality & Concurrency. Time-Stamping Systems. Plausibility. Example TSS: Lamport Clocks. Example TSS: Vector Clocks

Similar documents
Distributed Algorithms (CAS 769) Dr. Borzoo Bonakdarpour

Agreement. Today. l Coordination and agreement in group communication. l Consensus

Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms. CS 249 Project Fall 2005 Wing Wong

Today. Vector Clocks and Distributed Snapshots. Motivation: Distributed discussion board. Distributed discussion board. 1. Logical Time: Vector clocks

Absence of Global Clock

CptS 464/564 Fall Prof. Dave Bakken. Cpt. S 464/564 Lecture January 26, 2014

Logical Time. 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation

Clocks in Asynchronous Systems

Time is an important issue in DS

Ordering and Consistent Cuts Nicole Caruso

1 Introduction During the execution of a distributed computation, processes exchange information via messages. The message exchange establishes causal

Causal Consistency for Geo-Replicated Cloud Storage under Partial Replication

Snapshots. Chandy-Lamport Algorithm for the determination of consistent global states <$1000, 0> <$50, 2000> mark. (order 10, $100) mark

Causality and Time. The Happens-Before Relation

Distributed Algorithms

Distributed systems Lecture 4: Clock synchronisation; logical clocks. Dr Robert N. M. Watson

416 Distributed Systems. Time Synchronization (Part 2: Lamport and vector clocks) Jan 27, 2017

Reasoning about Time and Reliability

Cuts. Cuts. Consistent cuts and consistent global states. Global states and cuts. A cut C is a subset of the global history of H

Figure 10.1 Skew between computer clocks in a distributed system

1 Introduction During the execution of a distributed computation, processes exchange information via messages. The message exchange establishes causal

Time. To do. q Physical clocks q Logical clocks

Time. Today. l Physical clocks l Logical clocks

CSC501 Operating Systems Principles. Deadlock

Lecture and notes by: Alessio Guerrieri and Wei Jin Bloom filters and Hashing

The State Explosion Problem

Deadlock. CSE 2431: Introduction to Operating Systems Reading: Chap. 7, [OSC]

Distributed Systems. 06. Logical clocks. Paul Krzyzanowski. Rutgers University. Fall 2017

Chandy-Lamport Snapshotting

A subtle problem. An obvious problem. An obvious problem. An obvious problem. No!

MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at

CS505: Distributed Systems

Metric spaces and metrizability

Clock Synchronization

Slides for Chapter 14: Time and Global States

7680: Distributed Systems

Our Problem. Model. Clock Synchronization. Global Predicate Detection and Event Ordering

Chapter 11 Time and Global States

Analysis of Bounds on Hybrid Vector Clocks

Motivating examples Introduction to algorithms Simplex algorithm. On a particular example General algorithm. Duality An application to game theory

Petri nets. s 1 s 2. s 3 s 4. directed arcs.

Seeking Fastness in Multi-Writer Multiple- Reader Atomic Register Implementations

CS 425 / ECE 428 Distributed Systems Fall Indranil Gupta (Indy) Oct. 5, 2017 Lecture 12: Time and Ordering All slides IG

Time Synchronization

Immediate Detection of Predicates in Pervasive Environments

Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation

an information-theoretic model for adaptive side-channel attacks

Distributed Algorithms Time, clocks and the ordering of events

arxiv: v1 [cs.dc] 4 Oct 2018

Network Algorithms and Complexity (NTUA-MPLA) Reliable Broadcast. Aris Pagourtzis, Giorgos Panagiotakos, Dimitris Sakavalas

Classify, graph, and compare real numbers. Find and estimate square roots Identify and apply properties of real numbers.

Efficient Dependency Tracking for Relevant Events in Concurrent Systems

Time in Distributed Systems: Clocks and Ordering of Events

Algebraic Trace Theory

Expectation of geometric distribution. Variance and Standard Deviation. Variance: Examples

On Computational Limitations of Neural Network Architectures

Distributed Mutual Exclusion Based on Causal Ordering

6.852: Distributed Algorithms Fall, Class 24

Modeling and Analysis of Communicating Systems

Distributed Systems Fundamentals

CORRECTNESS OF A GOSSIP BASED MEMBERSHIP PROTOCOL BY (ANDRÉ ALLAVENA, ALAN DEMERS, JOHN E. HOPCROFT ) PRATIK TIMALSENA UNIVERSITY OF OSLO

Distributed Systems Time and Global State

Parallel Performance Evaluation through Critical Path Analysis

CS505: Distributed Systems

Using Happens-Before Relationship to debug MPI non-determinism. Anh Vo and Alan Humphrey

Ma/CS 6b Class 24: Error Correcting Codes

CSE613: Parallel Programming, Spring 2012 Date: May 11. Final Exam. ( 11:15 AM 1:45 PM : 150 Minutes )

Assignment 1: Functions of several variables.

Effective computation of biased quantiles over data streams

Expectation of geometric distribution

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

On Two Class-Constrained Versions of the Multiple Knapsack Problem

1 Probability Review. CS 124 Section #8 Hashing, Skip Lists 3/20/17. Expectation (weighted average): the expectation of a random quantity X is:

A Communication-Induced Checkpointing Protocol that Ensures Rollback-Dependency Trackability

Cambridge University Press The Mathematics of Signal Processing Steven B. Damelin and Willard Miller Excerpt More information

Computing the Entropy of a Stream

Efficient Algorithms for Checking the Atomicity of a Run of Read and Write Operations

Outline. EECS Components and Design Techniques for Digital Systems. Lec 18 Error Coding. In the real world. Our beautiful digital world.

CMPSCI 311: Introduction to Algorithms Second Midterm Exam

Gradient Clock Synchronization

1 Randomized Computation

Ch. 10 Vector Quantization. Advantages & Design

Comp487/587 - Boolean Formulas

On queueing in coded networks queue size follows degrees of freedom

12. LOCAL SEARCH. gradient descent Metropolis algorithm Hopfield neural networks maximum cut Nash equilibria

A Key Recovery Attack on MDPC with CCA Security Using Decoding Errors

Algorithms for Data Science

Discrete-Event Simulation:

FE670 Algorithmic Trading Strategies. Stevens Institute of Technology

Independence, Variance, Bayes Theorem

Implementation of the IEEE 1588 Precision Time Protocol for Clock Synchronization in the Radio Detection of Ultra-High Energy Neutrinos

Flip-N-Write: A Simple Deterministic Technique to Improve PRAM Write Performance, Energy and Endurance. Presenter: Brian Wongchaowart March 17, 2010

Connectedness. Proposition 2.2. The following are equivalent for a topological space (X, T ).

Lecture 8: Shannon s Noise Models

Theory of Computation

TECHNICAL REPORT YL DISSECTING ZAB

ECEE 352 Analog Electronics. DC Power Supply Winter 2016

Clojure Concurrency Constructs, Part Two. CSCI 5828: Foundations of Software Engineering Lecture 13 10/07/2014

14.1 Finding frequent elements in stream

Formal Methods for Monitoring Distributed Computations

Transcription:

Plausible Clocks with Bounded Inaccuracy Causality & Concurrency a b exists a path from a to b Brad Moore, Paul Sivilotti Computer Science & Engineering The Ohio State University paolo@cse.ohio-state.edu a b (a b (b a 2 Time-Stamping Systems A TSS is an algorithm for assigning time stamps to events, T(a time tags to messages Implementing a TSS requires STAMP( Input: previous local stamp, incoming tag Output: new local stamp TAG( Input: previous local stamp Output: tag to add to outgoing message COMP( Input: two time stamps Ouput: one of { <, =, } Example TSS: Lamport Clocks Time stamps are integers Time tags are integers STAMP: for local and send events, increase stamp for receive events, use max of stamp & tag TAG: use local time stamp to tag messages COMP: < and =, integer comparison when same value but on different processes 3 4 Example TSS: Vector Clocks Plausibility Time stamps are arrays of N integers Time tags are arrays of N integers STAMP: for local and send events, increase local element for receive events, use element-wise max of stamp & tag TAG: use local time stamp to tag messages COMP: < when all elements are <= and at least one is < = when all elements are = when some element is < and another is > Weak clock condition (WCC a b T(a < T(b A TSS satisfying the WCC is plausible iff it is consistent with underlying hb partial order every pair ordered by TSS is causally related no distinct events are given equal stamps Example: Lamport clocks orders (almost all pairs! exception: same value on different processes every pair identified as concurrent, is indeed concurrent in hb partial order stamps from distinct events can always be distinguished (add process id to stamp 5 6

Ordering from Lamport Clocks Application of Plausibility Correctly identifying causally related pairs generally necessary for safety arbitration (resource allocation, mutex consistent serialization (cache coherence playback for distributed debugging Correctly identifying concurrent pairs generally important for performance consistent cuts require concurrent sets cache consistency and invalidation protocols snapshots (deadlock & termination detection, checkpoints for rollback 7 8 Inaccuracy of a Plausible TSS Two kinds of errors: false concurrency : related events stamped concurrent WCC means a plausible TSS makes of none of these errors false ordering : concurrent events stamped as ordered plausible clocks may make this error Inaccuracy measures how many such mistakes (false orderings are made in a given run Fundamental result: perfect accuracy requires O(N message overhead (so Vector clocks are optimal does not scale to large systems Motivates natural research question: Can we get good expected-case accuracy with less message overhead? Designing a Plausible TSS Previous approaches: Fix time tag size (ie message overhead constant size Measure resulting accuracy through simulation expected case analysis 9 0 Inversion of Design Our approach: Fix inaccuracy some constant upper bound Measure resulting message complexity through simulation expected case analysis Towards a New Metric: Error Count (δ Error count for an event is the number of false (pre orderings, for that event P δ ( H, b = a H :: a b a b i.e., number of blue dots 2 2

Towards a New Metric: Inaccuracy (ρ Inaccuracy is the ratio of false orderings, averaged over entire run ( H :: ( H, b 2 δ ρ( H = i.e., ratio of dots to concurrent events Introducing a New Metric: Imprecision (ψ Imprecision is the max number of false (pre orderings for a given time stamp ψ ( s = ( Max H H( s, a H : P( a = s : δ ( H, a i.e., worst-case number of blue dots independent of particular run (property of a time stamp 3 4 Introducing a New Metric: Imprecision (ψ Imprecision is the max number of false (pre orderings for a given time stamp ψ ( s = ( Max H H( s, a H : P( a = s : δ ( H, a i.e., worst-case number of blue dots independent of particular run (property of a time stamp Algorithmic Approach Recall Vector Clocks stamp is an array of values, V[..N] V[i] is most recent event on process i 4 4 0 8 2 8 2 5 6 Compressing Time Tags If multiple entries have the same value, they can share an entry in vector problem: unlikely to have exact equality Use a range for vector entry most recent event guaranteed to be in range the larger the range, the greater the imprecision Allow ranges to grow/shrink (and number of vector entries to increase/decrease maintain constant precision message overhead may vary over the run Three Claims. The algorithm is a correct plausible TSS satisfies the WCC (and distinguishes events 2. The imprecision can be controlled different sources of imprecision: local stamps and tagged messages their combination does not lose too much information 3. The algorithm achieves good performance measured in terms of tag size expected case evaluation 7 8 3

Outline of the Talk Background model, causality (, concurrency, TSS Plausible TSS WCC, accuracy vs precision Algorithmic Approach use ranges instead of precise values Algorithm Description time intervals implementation of STAM TAG, COMP Justification of claims correctness (algorithm is a plausible TSS 2 imprecision is bounded 3 performance is reasonable 9 Time Intervals Interval given by beginning and end points if these are the same, interval is precise 4 24 5 An interval is associated with each process goal: the local time of the most recent causally related event is within the interval interval associated with this process is precise local storage is linear in N 20 Time Stamps A time stamp is a vector of intervals Satisfies two invariants: A imprecise intervals share the same end point B precise intervals are all greater than this value Time Tags Subset of time stamps a vector of intervals, with properties A & B Satisfies an additional invariant: C imprecise intervals share the same begin point all imprecise intervals are the same (a bucket 2 22 Implementation: STAMP Implementation: TAG For local/send events: increase local (precise interval For receive events (stamp + tag each interval in new stamp defined by: begin = max of begin points end = max of end points increase local (precise interval Given a time stamp and an imprecision budget: build smallest acceptable tag (ie use as big a bucket as possible Algorithm: start with everything in bucket repeat: move most recent interval from bucket to its own entry until bucket imprecision is within budget 23 24 4

Implementation: COMP Implementation: COMP Comparing individual intervals (i,j i = j : same precise intervals Comparing vectors of intervals (s,t s < t all i in s, j in t :: i < j i < j : no overlap, end of i < beg of j exists an i in s, j in t :: i < j s = t i j : some overlap all i in s, j in t :: i j s t i < j : (j < i exists an i in s, j in t :: i < j exists an i in s, j in t :: j < i 25 26 Justifying the Claims Claim : Correctness. The algorithm is a correct plausible TSS i. stamp and tag invariants [A-C] ii. a b T(a < T(b [WCC] iii. a = b T(a = T(b [no 2 equal stamps] 2. The imprecision is bounded (worst case 3. The algorithm achieves good performance Part (i: stamp and tag invariants imprecise intervals share an end point precise intervals are all greater than this value Proof intuition new shared end point = max of old shared end points 27 28 Claim : Correctness Claim : Correctness Part (ii: WCC holds a b T(a < T(b Surprising complication: < is not transitive i < j j < k (i < k Proof intuition along every actual chain, time stamps are non decreasing every happens-before pair is joined by a chain Part (iii: No two equal stamps a = b T(a = T(b Surprising complication: stamps are equal when all entries overlap Proof intuition: local interval is always precise for events on same process, the local interval is unique for events on different processes, both local intervals can not be identical equality of local interval implies causality hence, equality of both implies a cycle in causality 29 30 5

Claim 2: Guaranteed Bound Surprising since: stamp intervals can increase on receive! tagging increases imprecision Key observation: after receive, each stamp interval smaller than either old stamp or tag Important properties: ψ(stamp <= max(ψ(old stamp, ψ(tag ψ(tag <= BOUND Result: stable.ψ(stamp <= BOUND Claim 3: Good Performance Comparison challenges trade-off is similar (message size vs errors but imprecision is not accuracy! Simulation results varying number of processes fixed topology some high degree nodes some low varying intercommunication delays 3 32 Performance: Good News (Inaccuracy vs. Message Size Performance: Good (? News (Observed vs Bound 33 34 Conclusions Plausible clocks provide tradeoff between message size and accuracy Contribution: Imprecision metric property of a time stamp (run independent worst-case behavior unbounded for any constant message size Contribution: Bounded imprecision plausible clocks time stamps have intervals (messages have buckets message overhead grows and shrinks as necessary guarantee on amount of imprecision (hence inaccuracy Contribution: Promising performance actual accuracy generally better than imprecision bound Plausible Clocks with Bounded Inaccuracy Brad Moore, Paul Sivilotti Computer Science & Engineering The Ohio State University paolo@cse.ohio-state.edu 35 6

Bounding Inaccuracy Bounding Inaccuracy (Cont d Concurrency ratio, ε: ε ( H = 2 i.e., (avg number of events in concurrent window H Rewrite inaccuracy using ε(h 2 ρ( H = 2 ( H :: δ ( H, b ( b H :: ψ ( P. stamp( b ( b H :: ψ ( P. stamp( b = ε ( H BOUND ε ( H H For well-behaved computations, this is constant 37 38 Performance: Bucket Size 00000 90000 80000 70000 60000 50000 40000 30000 20000 s Bucket Size (vs Imp Width Time Stamp Size (vs Imp Width Time Stamp Size (vs Imp Normal Area Time Stamp Size MEDIAN (vs Imp Width Time Stamp Size MEDIAN (vs Imp Normal Area 0000 0 0 2 4 6 8 0 2 4 39 7