Source Offsets, Replay, and Recovery Positions

Record a position consistent with operator state and distinguish a broker’s delivery position from application completion.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. An offset names a boundary within a partition
  2. Ordering and retention determine whether replay is possible

An offset names a boundary within a partition

If a consumer has applied records through offset seven and stores the next offset as eight, recovery should resume at eight with state including record seven. Persisting offset eight before its corresponding state can lose work after a failure. Persisting state that already includes it while resuming earlier can process some records again. The offset convention must be explicit.

Ordering and retention determine whether replay is possible

Offsets commonly order one input partition, without imposing a total order over independent partitions. Recovery needs both a consistent position per partition and retention long enough to read the necessary records. Repartitioning or consumer reassignment changes ownership, so active and recovered processing need compatible rules. Checkpoints tie positions to state. Log compaction discusses cases where older records may be omitted under a different replay contract.[1][2]

References

  1. Tyler Akidau et al., The Dataflow Model ↩
  2. Apache Beam, Programming Guide ↩