Distributed System (3)
Omission
- Omission: when a process or a channel fails to perform actions that it is supposed to do.
- ping-ack or heartbeat
- Communication omission:
- mitigated by network protocols.
Extending heartbeats
Centralized heartbeating
graph BT
a(a) ---|Heartbeat | b((b))
a(a) --- c((c))
a(a) --- d((d))
a(a) --- e((e))
Ring heartbeating
graph LR
a(a) --- b(b)
b(b) --- c(c)
c(c) --- d(d)
d(d) ---|Heartbeat| a(a)
All-to-all heartbeats (All-to-all heartbeats)
Types of failure
- Omission: when a process or a channel fails to perform
actions that it is supposed to do, e.g. process crash and
message drops. - Arbitrary (Byzantine) Failures: any type of error, e.g. a
- process executing incorrectly, sending a wrong message, etc.
- Timing Failures: Timing guarantees are not met.
- Applicable only in synchronous systems.
Time and Clocks
Clock Skew and Drift Rates
- Clock skew: relative difference between two clock values.
- Clock drift rate: change in skew from a perfect reference clock per
unit time (measured by the reference clock).
forms of synchronization
-
External synchronization
- Synchronize time with an authoritative clock.
- When accurate timestamps are required.
-
Internal synchronization
- Synchronize time internally between all processes in a distributed
system. - When internally comparable timestamps are required.
- Synchronize time internally between all processes in a distributed
Synchronization Bound
Synchronization bound (D) between two clocks A and B over
a real time interval I:
- |A(t) – B(t)| < D, for all t in the real time interval I.
- If A is authoritative, D can also be called accuracy bound.
Synchronization in asynchronous systems
Cristian Algorithm
then
where is minimum one way network delay.
Berkeley Algorithm
Berkeley Algorithm for internal synchronization
- Server periodically polls clients: “what time do you think it is?”
- Each client responds with its local time.
- Server uses Cristian algorithm to estimate local time at each client.
- Average all local times (including its own) – use as updated time
- Send the offset (amount by which each clock needs adjustment).
NTP Symmetric Mode
- and are local timestamps at .
- and are local timestamps at .
- and : actual transmission times for and (unknown)
- : true offset of clock at B relative to clock at A
- : estimate of actual offset between the two clocks
- : estimate of accuracy of / total transmission times for and .
relations:
Distributed System (3)
https://yzzzf.xyz/2024/02/19/distributed-system-3/