How do you take a "photo" of a distributed system when there's no global clock and messages are in flight? The Chandy-Lamport algorithm records a consistent global state without pausing the system, and it underpins checkpointing in modern stream processors.
A snapshot is consistent if, for every message recorded as received, its send is also recorded. Equivalently, it's a cut where no effect appears without its cause. Messages sent before the cut but received after must be captured as channel state.
The marker separates "before the snapshot" from "after" on each channel. If channels could reorder, a post-snapshot message could overtake the marker and be wrongly included in the recorded state.
Apache Flink uses a variant called asynchronous barrier snapshotting. Sources inject barriers into the stream; an operator with multiple inputs aligns barriers (buffering inputs that are ahead) and then snapshots its state to durable storage. Because the dataflow is mostly acyclic, channel state often doesn't need recording, and unaligned checkpoints trade larger snapshots for lower latency under backpressure.
Disclosure: from the people building Linkjob AI, an AI copilot for system design interviews.