Open LZDQ opened 4 days ago
L06
Algorithm | Type | Message Complexity | Advantages | Disadvantages |
---|---|---|---|---|
Centralized Mutex | Centralized | $3$ | - Simple implementation - Low message overhead |
- Single point of failure - Coordinator bottleneck |
Bully Algorithm | Centralized | $O(n^2)$ | - Handles coordinator failure - Selects highest priority node |
- High message overhead - Assumes no message loss |
Fully Decentralized | Decentralized | $2m + m$ | - No central coordinator - Ensures majority vote consistency |
- High message count - Vulnerable to node failures |
Lamport Mutual Exclusion | Decentralized | $3(n-1)$ | - Simple logical clocks - No single point of failure |
- High message overhead - Message reordering affects accuracy |
Ricart & Agrawala | Decentralized | $2(n-1)$ | - Reduces messages compared to Lamport - Handles fairness well |
- Still depends on logical clock accuracy - Unbounded wait time |
Token Ring Algorithm | Token-based | $O(1)$ | - Low message complexity - Fairness guaranteed |
- Token loss requires regeneration - Requires logical ring |
Comparisons:
L07
Fail-Stop: no malicious machines but crashes Byzantine: malicious machines
Primary-Backup
Quorum-Based Replication
Replicated State Machine (RSM)
async: packets could be delayed/lost
Paxos is guaranteed safe. Consensus is a stable property: once reached it is never violated; the agreed value is not changed.
Paxos is not guaranteed live. Consensus is reached if “a large enough subnetwork...is non-faulty for a long enough time.” Otherwise Paxos might never terminate.
In CAP setting, Paxos choose C+P, but no A.
Proposer suggests values Acceptor receives values but doesn't suggest any TODO: learn this
L05
Time
Wall clock
Cristian accuracy: RTT/2 –
assumption: RTT/2 $\simeq$ , but packets could be queued
NTP Uses UDP to avoid handshake 1 RTT record four timestamps:
offset = $\dfrac{((t2-t1) + (t3-t4))}2$ client time += offset
Lamport time
with total order: multiply the ID by, then add by
vector time