◄ WORLD V · SONNY 5DART 219 · a helldive at the net

THE CHANDY-LAMPORT SNAPSHOT photograph a running system without stopping it

How do you capture a consistent global state of a distributed system that never pauses? Chandy–Lamport: one process records its own state and sends a marker down every outgoing channel; each process, on its first marker, records its state and then records every message arriving on other channels until their markers come too. The result is a consistent cut — and any global invariant, like the total number of tokens in flight plus at rest, is exactly preserved across it.

THE TECHNIQUE markers cut the channels; node states + recorded in-flight = a consistent global state

Snapshot a system of nodes holding tokens with more tokens in flight on the channels — the marker algorithm captures node states plus channel contents, and their sum equals the true global total, no matter that the system kept running: live demo


HISTORY & CREDIT Chandy & Lamport, 1985

“To get a clean global state you must freeze every node at the same instant — which distributed systems cannot do.” — you never need a shared instant. The markers define a consistent cut in causal time, not wall-clock time, and the recorded channel messages account for exactly the tokens that were mid-flight. Nothing stops; nothing is miscounted. cited

1985 · K. Mani Chandy & Leslie Lamport — “Distributed Snapshots: Determining Global States of Distributed Systems”: the marker algorithm.
1987 · Lai & Yang — a snapshot without markers, by coloring messages.
now · Apache Flink's exactly-once checkpointing is Chandy–Lamport in production, snapshotting streaming state mid-flow.

The snapshot may never have existed at any single moment — yet it is a state the system could have been in, consistent with causality, and every conserved quantity checks out. A photograph of a river that no instant of the river ever matched. Chandy–Lamport 1985

RECOMMEND FOR I-13 tokens conserved across the consistent cut, computed

On the canonical compiler, nodes holding 4+1+2 tokens with 2+1 more in flight snapshot to a total of 10 — exactly the global invariant, conserved across the cut:

$ i13 run snapshot.i13 # nodes [4,1,2], channels [2,1] in flight snapshot = 10 -- node states 7 + recorded in-flight 3 conserved = 0 -- snapshot total EQUALS the global invariant 10
Recommend: the Chandy–Lamport snapshot is LIT for I-13 — verified node tokens [4,1,2] plus in-flight [2,1] snapshot to 10, conserving the global total exactly across the consistent cut. It records a coherent global state of a system that never stopped — the basis of every exactly-once checkpoint.