Introduction. Leslie Lamports Time, Clocks & the Ordering of Events in a Distributed System. Overview. Introduction Concepts: Time

Similar documents
On-line Scheduling Algorithm with Precedence Constraint in Embeded Real-time System

EXTENDED FORMAL SPECIFICATIONS OF 3D SPATIAL DATA TYPES

For instance, ; the five basic number-sets are increasingly more n A B & B A A = B (1)

Optimization Methods: Integer Programming Integer Linear Programming 1. Module 7 Lecture Notes 1. Integer Linear Programming

An Efficient Fault-Tolerant Multi-Bus Data Scheduling Algorithm Based on Replication and Deallocation

ON SOME ENTERTAINING APPLICATIONS OF THE CONCEPT OF SET IN COMPUTER SCIENCE COURSE

CMPS 10 Introduction to Computer Science Lecture Notes

On Some Entertaining Applications of the Concept of Set in Computer Science Course

Compiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Solutions to Programming Assignment Five Interpolation and Numerical Differentiation

Array transposition in CUDA shared memory

Prediction of Dumping a Product in Textile Industry

F Geometric Mean Graphs

Hermite Splines in Lie Groups as Products of Geodesics

Measuring Cohesion of Packages in Ada95

Color Image Segmentation Based on Adaptive Local Thresholds

Generating Fuzzy Term Sets for Software Project Attributes using and Real Coded Genetic Algorithms

6.854 Advanced Algorithms Petar Maymounkov Problem Set 11 (November 23, 2005) With: Benjamin Rossman, Oren Weimann, and Pouya Kheradpour

Complex Numbers. Now we also saw that if a and b were both positive then ab = a b. For a second let s forget that restriction and do the following.

A system based on a modified version of the FCM algorithm for profiling Web users from access log

Virtual Memory. Background. No. 10. Virtual Memory: concept. Logical Memory Space (review) Demand Paging(1) Virtual Memory

CHAPTER 2 DECOMPOSITION OF GRAPHS

Estimating Progress of Execution for SQL Queries

an assocated logc allows the proof of safety and lveness propertes. The Unty model nvolves on the one hand a programmng language and, on the other han

Non-Split Restrained Dominating Set of an Interval Graph Using an Algorithm

Cell Count Method on a Network with SANET

UNIT 2 : INEQUALITIES AND CONVEX SETS

ALM-FastReplica: Optimizing the Reliable Distribution of Large Files within CDNs

A NOTE ON FUZZY CLOSURE OF A FUZZY SET

126 Int. J. Ad Hoc and Ubiquitous Computing, Vol. 1, No. 3, Djamel Djenouri*

Module Management Tool in Software Development Organizations

2016 International Conference on Sustainable Energy, Environment and Information Engineering (SEEIE 2016) ISBN:

User Behavior Recognition based on Clustering for the Smart Home

A Theory of Non-Deterministic Networks

Load Balancing for Hex-Cell Interconnection Network

On Correctness of Nonserializable Executions

Merging Results by Using Predicted Retrieval Effectiveness

AMath 483/583 Lecture 21 May 13, Notes: Notes: Jacobi iteration. Notes: Jacobi with OpenMP coarse grain

Bridges and cut-vertices of Intuitionistic Fuzzy Graph Structure

EECS 730 Introduction to Bioinformatics Sequence Alignment. Luke Huan Electrical Engineering and Computer Science

Scheduling Workflow Applications on the Heterogeneous Cloud Resources

Oracle Database: SQL and PL/SQL Fundamentals Certification Course

Reading. 14. Subdivision curves. Recommended:

Math Homotopy Theory Additional notes

Lecture #15 Lecture Notes

Human Face Recognition Using Radial Basis Function Neural Network

Tsinghua University at TAC 2009: Summarizing Multi-documents by Information Distance

such that is accepted of states in , where Finite Automata Lecture 2-1: Regular Languages be an FA. A string is the transition function,

A Binarization Algorithm specialized on Document Images and Photos

Specifying Database Updates Using A Subschema

APPLICATION OF MULTIVARIATE LOSS FUNCTION FOR ASSESSMENT OF THE QUALITY OF TECHNOLOGICAL PROCESS MANAGEMENT

Load Balancing Algorithm for Web Server Based on Weighted Minimal Connections

Handwritten English Character Recognition Using Logistic Regression and Neural Network

Mathematics 256 a course in differential equations for engineering students

Multi-Constraint Multi-Processor Resource Allocation

The Codesign Challenge

Cluster Analysis of Electrical Behavior

IP Camera Configuration Software Instruction Manual

Sorting Review. Sorting. Comparison Sorting. CSE 680 Prof. Roger Crawfis. Assumptions

Concurrent models of computation for embedded software

The example below contains two doors and no floor level obstacles. Your panel calculator should now look something like this: 2,400

Lecture 5: Multilayer Perceptrons

Brave New World Pseudocode Reference

Parallel matrix-vector multiplication

Report on On-line Graph Coloring

Multicast Tree Rearrangement to Recover Node Failures. in Overlay Multicast Networks

Vectorization in the Polyhedral Model

Research on action recognition method under mobile phone visual sensor Wang Wenbin 1, Chen Ketang 2, Chen Liangliang 3

A Novel Fuzzy Classifier Using Fuzzy LVQ to Recognize Online Persian Handwriting

Transaction-Consistent Global Checkpoints in a Distributed Database System

Vertex Degrees in Planar Maps

Hierarchical clustering for gene expression data analysis

Wightman. Mobility. Quick Reference Guide THIS SPACE INTENTIONALLY LEFT BLANK

Concurrent Apriori Data Mining Algorithms

An Approach in Coloring Semi-Regular Tilings on the Hyperbolic Plane

A study of Adaptive Replication Technique in routing time-constrained messages (VoIP) in MANET

Problem Definitions and Evaluation Criteria for Computational Expensive Optimization

Multiple Instance Learning via Multiple Kernel Learning *

A New Approach For the Ranking of Fuzzy Sets With Different Heights

Comparative Study between different Eigenspace-based Approaches for Face Recognition

TN348: Openlab Module - Colocalization

Performance Evaluation of Information Retrieval Systems

A New Scheduling Algorithm for Servers

TWO DIAGNOSTIC MODELS FOR PLC CONTROLLED FLEXIBLE MANUFACTURING SYSTEMS. W. HU*, A. G. STARR* and A. Y. T. LEUNG*

R s s f. m y s. SPH3UW Unit 7.3 Spherical Concave Mirrors Page 1 of 12. Notes

Routability Driven Modification Method of Monotonic Via Assignment for 2-layer Ball Grid Array Packages

Outline. Third Programming Project Two-Dimensional Arrays. Files You Can Download. Exercise 8 Linear Regression. General Regression

2x x l. Module 3: Element Properties Lecture 4: Lagrange and Serendipity Elements

THE PHYSICS 23 LAB BOOK 23 Lab 03: Conservation of Linear Momentum

An Adaptive Sleep Strategy for Energy Conservation in Wireless Sensor Networks

Heuristic Methods for Locating Emergency Facilities

Motivation. EE 457 Unit 4. Throughput vs. Latency. Performance Depends on View Point?! Computer System Performance. An individual user wants to:

Cordial and 3-Equitable Labeling for Some Star Related Graphs

Tracing Anonymous Mobile Attackers in Wireless Network

Estimating Costs of Path Expression Evaluation in Distributed Object Databases

Ramsey numbers of cubes versus cliques

FAST IMAGE INDEXING AND VISUAL GUIDED BROWSING

STATIC MAPPING FOR OPENCL WORKLOADS IN HETEROGENEOUS COMPUTER SYSTEMS

A mathematical programming approach to the analysis, design and scheduling of offshore oilfields

ALEKSANDROV URYSOHN COMPACTNESS CRITERION ON INTUITIONISTIC FUZZY S * STRUCTURE SPACE

Transcription:

Lesle Laports e, locks & the Orderng of Events n a Dstrbuted Syste Joseph Sprng Departent of oputer Scence Dstrbuted Systes and Securty Overvew Introducton he artal Orderng Logcal locks Orderng the Events otally Anoalous Behavour hyscal locks oncluson Appendx Laports: e, locks and Events 1 Laports: e, locks and Events 2 Introducton Laports: e, locks and Events 3 Introducton oncepts: e Fundaental to our way of thnkng Derved fro ore basc concept of order n whch events occur eporal Orderng of Events ervades thnkng about systes Must be carefully exaned for Dstrbuted Systes Laports: e, locks and Events 4 Introducton Dstrbuted Syste: A collecton of dstnct processes whch are spatally separated and whch councate wth one another by exchangng essages E.g. ARA net opare to prevous defntons Includes sngle coputer entral control unt, eory unts, nput-output channels are separate processes aper concerned prarly wth systes of spatally separated coputers Soetes possble to say that one of two events occurred frst Laports: e, locks and Events 5 Introducton Dscusson nvolves happened before relaton a partal orderng of the events n a syste dstrbuted algorth for extendng happened before relaton to a consstent otal Orderng of all events Mechans for pleentng a dstrbuted syste Illustraton va synchronsaton proble Unexpected anoalous behavour can occur f orderng obtaned fro algorth s dfferent to that perceved by the user Avoded through ntroducton of real physcal clocks Descrbe ethod for synchronsaton of clocks Derve upper bound for drft Laports: e, locks and Events 6

Introducton he roble? he artal Orderng Laports: e, locks and Events 7 Laports: e, locks and Events 8 he Syste Assuptons Syste coposed of a collecton of processes Each process conssts of a sequence of events E.g. executon of a subprogra, executon of a sngle achne nstructon Events of a process for a sequence Event a occurs before b f a happens before b In other words: A sngle process s defned to be a set of events wth an a pror total orderng, (see footnote 1 regardng events) Sendng or recevng a essage s an event n a process Laports: e, locks and Events 9 he Happened Before Relaton Defnton he relaton " " on the set of events of a syste s the sallest relaton satsfyng the followng three condtons: 1. If a and b are events n the sae process, and a coes before b, then a b 2. If a s the sendng of a essage by one process and b s the recept of the sae essage by another process, then a b 3. If a b and b c then a c Laports: e, locks and Events 10 he Happened Before Relaton wo events a and b are sad to be concurrent f a b and b a Assuptons (contnued) a a for any event a We note that s an rreflexve partal orderng on the set of all events n the syste Laports: e, locks and Events 11 Space e Dagra Horzontal drecton space Vertcal drecton - te Up drecton postve, ndcatng later tes Dots denote events Vertcal lnes denote processes Wavy lnes denote essages We Note (assupton/set up odel (p.559)) Messages ay be receved out of order Sendng of several essages ay be consdered a sngle event Recept of a sngle essage does not concde wth the sendng or recept of any other essage Laports: e, locks and Events 12

Happened Before relaton a b eans that one can go fro a to b n the dagra by ovng forward n te along process and essage lnes Exaple p r 1 4 snce p q, by HB2; q q, by HB1; 1 2 2 4 q r, by HB2 and r r by HB1 4 3 3 4 Hence by repeated applcaton of HB3 p r 1 4 Laports: e, locks and Events 13 Happened Before relaton Alternatve vew of defnton a b eans that event a can causally affect event b wo events events are sad to be concurrent f nether can causally affect the other Exaple p and q 3 3 are concurrent, snce process cannot know what process Q dd at q the essage at p 4 3 untl t receves Laports: e, locks and Events 14 Happened Before relaton Note ror to event p Q was plannng to do at q 4 can at ost, know what 3 Space-e Dagra See Laports aper hs follows snce q 2 s the event recevng a essage fro, and ths ay or ay not reveal nforaton regardng q 3 Laports: e, locks and Events 15 Laports: e, locks and Events 16 Logcal locks Abstract locks he Model A clock s ust a way of assgnng a nuber to an event he nuber s nterpreted as the te at whch an event occurred Hence we ay eploy Logcal rather than hyscal clocks We proceed as follows: Laports: e, locks and Events 17 Laports: e, locks and Events 18

Logcal locks More precsely: We defne a clock for each process to be a functon whch assgns a nuber a to any event a n that process he entre syste of clocks s represented by a functon assgns to any event b n process nuber b = b Laports: e, locks and Events 19 the Logcal locks Note: No assupton s ade regardng any relaton between the < a > and physcal te We thnk of these clocks as Logcal rather than hyscal he logcal clocks ay be ncreented by counters wth no actual tng echans Laports: e, locks and Events 20 Logcal locks Queston: What does t ean for such a set of clocks to be correct? Answer: Snce we cannot base our defnton on physcal te we base t on the order n whch events occur Strongest reasonable assupton: If an event a occurs before event b then event a should happen at an earler te than event b Laports: e, locks and Events 21 lock ondton More forally we have: For any events a and b : f a b then ( a) < ( b) Note the converse doesn t hold! In the sense that: f a b then a = b Laports: e, locks and Events 22 lock ondton he clock condton s satsfed f the followng two condtons hold: 1 If a and b are events n process, and a coes before b, then ( a) < ( b) locks and the Space-e Dagra See Laports aper 2 If a s the sendng of a essage by process,and b s the recept of that essage by process () a < ( b), then Laports: e, locks and Events 23 Laports: e, locks and Events 24

locks and the Space-e Dagra See Laports aper locks and the Space-e Dagra See Laports aper Laports: e, locks and Events 25 Laports: e, locks and Events 26 Introducng locks nto rocesses Assue rocesses are now algorths Events represent actons durng the executon of the processes We consder how to ntroduce clocks nto the processes whch satsfy the clock condton Laports: e, locks and Events 27 Introducng locks nto rocesses We note: rocess 's clock s represented by regster, so a represents the value contaned by event a he value durng the wll change between events so that changng consttute an event doesn't Laports: e, locks and Events 28 Introducng locks nto rocesses We note: o guarantee the syste of clocks satsfes the clock condton we nsure that condtons are stsfed and 1 2 Introducng locks nto rocesses For condton 1 the followng pleentaton rule s obeyed: IR1. Each process ncreents between any two successve events Laports: e, locks and Events 29 Laports: e, locks and Events 30

Introducng locks nto rocesses For condton estaps 2 the use of s requred. Each essage contans a testap whch corresponds to the te the essage s sent. Upon recept of a essage wth testap a process ust advance ts clock to be later than. Laports: e, locks and Events 31 Introducng locks nto rocesses More precsely we have: IR2. a) If event a s the sendng of a essage by a process then the essage contans a testap b) Upon recevng a essage Laports: e, locks and Events 32 = a process sets greater than or equal to ts present value and greater than Note he pleentaton rules IR1 and IR2 Iply that the clock condton s satsfed Guarantee a correct syste of logcal clocks We now consder the concept of total orderng on the set of all syste events: Orderng he Events otally Laports: e, locks and Events 33 Laports: e, locks and Events 34 otal Orderng We acheve ths by: Orderng the events accordng to the tes at whch they occur Breakng tes by usng any arbtrary total orderng of the processes Laports: e, locks and Events 35 otal Orderng We defne a relaton as follows: If a s an event n process and and b s an event n process then a b f and only f ether: ) a < b or ) a = b and hs defnes a total orderng he clock condton ples that f a b then a b A copletng of the happened before partal orderng to a total orderng Laports: e, locks and Events 36

otal Orderng - Exaple he Mutual Excluson roble We seek an Algorth satsfyng: 1. A process whch has been granted a resource ust release the resource before t can be granted to another process 2. Dfferent requests for a resource ust be granted n the order n whch they are ade 3. If every process whch s granted a resource eventually releases t then every request s eventually granted Laports: e, locks and Events 37 otal Orderng - Exaple he Mutual Excluson roble We assue that the resource s ntally granted to one process o solve the proble a syste of clocks satsfyng IR1 and IR2 s pleented to defne a total orderng of all events, hence a total orderng of all requests and release operatons Laports: e, locks and Events 38 Mutual Excluson roble Splfyng Assuptons 1. For any two processes and we assue that essages sent fro to are receved n the sae order as sent 2. Every essage s receved hese are reasonable - the use of the ARQ protocol accoodates the splfcaton Laports: e, locks and Events 39 Mutual Excluson roble Splfyng Assuptons 3. A process ay send esages drectly to every other process 4. Every process antans ts own request queue, whch s not seen by other processes Assue request queues contan a sngle essage : requests resource where 0 0 0 s the process ntally granted the resource and value of any clock 0 s less than the ntal Laports: e, locks and Events 40 Mutual Excluson roble he Algorth (actons defned by each rule are assued to be a sngle event) 1. o request a resource, a process sends the essage : requests resource to every other process and puts that essage on ts request queue, s the testap of the essage 2. When process receves the essage : requests resource t places t on ts request queue and sends a (testaped) acknowledgeent essage to Laports: e, locks and Events 41 Mutual Excluson roble he Algorth 3. o release the resource, process reoves any : requests resource essage fro ts request queue and sends a (testaped) releases resource essage to every other process 4. When process receves a releases resource essage, t reoves any : requests resource essage fro ts request queue Laports: e, locks and Events 42

Mutual Excluson roble 5. b) has receved a essage fro every other process testaped later than Verfy that the algorth defned by these rules satsfes condtons 1), 2) and 3) of the Mutual Excluson roble Anoalous Behavour Laports: e, locks and Events 43 Laports: e, locks and Events 44 Strong lock ondton Exaple Request a s ssued on coputer A erson akng request at A phones frend at coputer B n another cty and gets frend to ssue a request b It s possble that the testap at B wll have a lower testap than that at A and be ordered before request a Laports: e, locks and Events 45 Strong lock ondton Let S denote the set of all syste events Let S = S {' relevant external events'} Let denote the 'happened before' relaton for S In the above exaple we have a b but a b No algorth based entrely on events n S whch does not relate the events to other events n S can guarantee that request a s ordered before request b Laports: e, locks and Events 46 Strong lock ondton wo ethods avalable: 1. Get frend at B to request a testap later than that of a 2. onstruct a syste of clocks that satsfy the 'Strong lock ondton' For any events a, b S f a b then a < b hyscal locks hs s stronger than the ordnary lock condton snce s stronger than It s not n general satsfed by logcal clocks Laports: e, locks and Events 47 Laports: e, locks and Events 48

Overvew We use physcal clocks to elnate anoalous behavour oncluson Laports: e, locks and Events 49 Laports: e, locks and Events 50 Overvew Introducton he artal Orderng Logcal locks Orderng the Events otally Anoalous Behavour hyscal locks hyscal locks oncluson Appendx Laports: e, locks and Events 51 Appendx Laports: e, locks and Events 52 Overvew Introducton he artal Orderng Logcal locks Orderng the Events otally Anoalous Behavour hyscal locks hyscal locks oncluson Appendx Laports: e, locks and Events 53 Suary Introducton he artal Orderng Logcal locks Orderng the Events otally Anoalous Behavour hyscal locks oncluson Appendx Laports: e, locks and Events 54