Lamport clock
A Lamport clock assigns scalar logical timestamps that increase along happened-before relations without identifying every causal dependency.
For integer counters, increment before each local or send event; timestamp a receive with max(local, message) + 1. Thus a -> b implies C(a) < C(b), but the converse fails. [1]
Ordering first by timestamp and then by a fixed order of unique process IDs gives a total order consistent with causality, not elapsed time or proof of communication. [1]
COPS (2011) combines a Lamport clock with a unique node identifier to order versions for last-writer-wins conflict handling. It separately checks dependencies before exposing remotely replicated writes. The version number alone does not establish dependency availability. [2]
Relations
Citations
- Leslie Lamport. Time, Clocks, and the Ordering of Events in a Distributed System. Communications of the ACM 21(7), 558-565, July 1978; pp. 559-562.
- Lloyd et al. Don't Settle for Eventual: Scalable Causal Consistency for Wide-Area Storage with COPS. SOSP 2011, sections 3, 4.4 and 5.3.
Sources & caveats
- Lamport 1978, printed pp. 559-562: Clock Condition, integer implementation and total-order construction. The formula is a valid unit-increment implementation, not a verbatim quotation.
- COPS 2011, sections 4.4 and 5.3: version construction and separate dependency checks. Source synthesis, not a system benchmark.