Skip to main content

Timestamp snapshots and comparison

What this concept is​

A Lamport counter respects causal edges but cannot classify all concurrent pairs. A vector retains one progress component per process; in this complete fixed-membership model, componentwise order captures graph causality. Snapshots belong to events, not to a mutable current-clock object.

Why it matters here​

Changing a vector after attaching it to a send rewrites the past and can transmit knowledge the sender did not yet possess. Comparing only one component or requiring every component to be strictly smaller also misclassifies causal pairs.

Concrete example​

A sends m with vector (1,0,0), then advances locally to (2,0,0). B has (0,1,0) before receiving m. Its receive result is (1,2,0), using the send-time snapshot, not A’s later state. If B sends n and C receives it, the resulting vectors are (1,3,0) and (1,3,1).

Common confusion / misconception​

Before means every component is <= and at least one is <; equal components are allowed. Equal vectors are a separate comparison result. For arbitrary caller-supplied vectors, equality does not prove two records are the same event.

How to use it​

On receive, merge the message snapshot componentwise, then increment the receiver’s component. Local/send events increment only their own component. Freeze returned and transmitted vectors as tuples. Test against graph ancestry rather than a second copy of the same clock update algorithm.

Check yourself​

Compare (1,0) with (2,0), then (2,0) with (0,1). Why can Lamport numbers 2 and 1 coexist for that concurrent pair?

Mini drill or application​

Mutate a send snapshot intentionally by retaining a shared list. Construct a later local event before delivery and show the false dependency it creates. Repair with an immutable snapshot.

Read this only if stuck​

Use DDIA for ordering concepts and the Cambridge logical-time lecture for vector clocks. These are supporting explanations, not additional full-course assignments.