recall

← recall

high water mark pattern

In a replicated log, the highest position that's been safely replicated to a quorum (or, in some systems, the position visible to readers). Anything up to the HWM is considered durable / readable; anything beyond may be rolled back if the leader fails before replication completes. The exact semantics differ across systems (Raft commit index, Kafka HWM, etc.) but the shape is the same.

In a replicated log, the highest position that's been safely replicated to a quorum (or, in some systems, the position visible to readers). Anything up to the HWM is considered durable / readable; anything beyond may be rolled back if the leader fails before replication completes. The exact semantics differ across systems (Raft commit index, Kafka HWM, etc.) but the shape is the same.

symptoms

  • readers seeing data that gets rolled back after leader change
  • replicas confused about what's committed

causes

  • no explicit commit-index tracking
  • reads going to non-leader without HWM check

fixes

  • leader tracks last-replicated-by-quorum index
  • reads only consult log up to HWM
  • replicas refuse uncommitted serves

you might say

  • HWM
  • commit index
  • safely replicated up to N

related

aliases: HWM, commit index

topics: distributed-systems, replication

references: