0% found this document useful (0 votes)
50 views

Distributed Computing: Lecture 3 Coordination in Distributed Systems Logical Clocks

Distributed computing concepts like logical clocks help with coordination across distributed systems. Logical clocks assign timestamps to events in a way that preserves causality, addressing issues like allowing concurrent updates while ensuring consistency. Specifically, Lamport's logical clocks use scalar timestamps while vector clocks capture causality with timestamp vectors. Both approaches ensure that if event A happened before B, A will always be observed as happening first during execution.

Uploaded by

TESFAHUN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Distributed Computing: Lecture 3 Coordination in Distributed Systems Logical Clocks

Distributed computing concepts like logical clocks help with coordination across distributed systems. Logical clocks assign timestamps to events in a way that preserves causality, addressing issues like allowing concurrent updates while ensuring consistency. Specifically, Lamport's logical clocks use scalar timestamps while vector clocks capture causality with timestamp vectors. Both approaches ensure that if event A happened before B, A will always be observed as happening first during execution.

Uploaded by

TESFAHUN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Distributed Computing

Lecture 3 Coordination in Distributed Systems


Logical Clocks

Slides adopted from the instructional material of the textbook


Distributed Systems: Principles and Paradigms by Andrew S. Tanenbaum, Maarten van Steen.
• Distributed system concepts
• Distributed system design goals
• DG 1: Resource Sharing
• DG 2 : Distributed Transparency
• DG 3 :Openness
• DG 4: Scalability
• Architecture styles
• Decentralized Organization-P2P
• Coordination in Distributed Systems:
• Logical Clocks
• Lamport’s Logical Clocks
• Vector Clocks
Developing Distributed Systems: Pitfalls
Coordination in Distributed
Systems:
- Logical Clocks
- Lamport’s Logical Clocks
- Vector Clocks

Reading Assignment Clock Synchronization:


Text book 6.1
The Happened-before Relation
Logical Clocks
Lamport’s Distributed Algorithm
Logical clocks: Example
Logical clocks: where implemented

Message receipt: from the network


Message delivery: by the application
Logical time as a time-space picture
p0 a

a, b are concurrent
c
p1
c happens after a, b

b
p2
What can you say about a and b?
d
p3
• a  c, b  c, c d d happens after a, b, c
Examples • hence, a  d, b d
• a, b are concurrent
Illustration of logical timestamps

Example
C(a)=1 C(d)=2
p0
a d

e C(f)=5
p1 f
C(e)=3

p2 C(b)=1
b
C(g)=6
C(c)=1
p3
c g
Example: Total-ordered multicast
Concurrent updates on a replicated database are seen in the same order
everywhere
P1 adds $100 to an account (initial value: $1000)
P2 increments account by 1%
There are two replicas

Update 1 Update 2

Replicated database
Update 1 is Update 2 is
performed before performed before
update 2 update 1

Result
In absence of proper synchronization:
replica #1 ← $1111, while replica #2 ← $1110.
Example: Total-ordered multicast
Vector timestamps

• Lamport timestamps do not capture causality


• Causality example
• Principles of vector timestamps
• Examples
• Guaranteeing causal message delivery
• Example: Causally ordered multicasting
• Questions
• (Reading: Section 6.2 of the textbook)
Lamport timestamps do not
capture causality
Causal dependency
Vector Clock
Capturing causality
Events, Lamport timestamps, Vector timestamps

Events occurring at three processes

Lamport timestamps for the events

Vector timestamps for the events


Vector clocks: Example
Causally ordered multicasting
Causally ordered multicasting

You might also like