Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Kafka Streams State Recovery

State recovery combines local state, changelog topics, task assignment, and processing guarantees. Do not delete local state before establishing which recovery source is healthy.

Record application ID, process ID, client ID, thread/task/store names, assigned input and changelog partitions, state directory, restore offsets/rate, thread state, rebalance history, transaction errors, and uncaught-exception response.

Check:

  • state-directory mount, capacity, permissions, and I/O latency;
  • changelog topic existence, retention, compaction, ISR, and authorization;
  • restore-consumer fetch errors and lag;
  • repeated task migration or member fencing;
  • RocksDB/background errors and open-file limits;
  • transaction coordinator and output topic health for exactly-once processing.
PatternLikely cause
Full restore every restartEphemeral/missing state volume, changing instance identity, state cleanup
Restore never catches upInput rate, slow disk/network, insufficient instances, changelog issue
Same task repeatedly migratesGroup instability or process/resource failure
Local store corruptionDisk/filesystem/process crash or RocksDB failure
Transaction fencingDuplicate instance/transactional identity or task movement
  • Restore the state volume or fix storage capacity/latency.
  • Restore changelog topic availability and authorization.
  • Stabilize group membership before adding more instances.
  • Quarantine a corrupt local store only after confirming the changelog can rebuild it.
  • Use the Streams application reset tool only for an intentional logical reset with the application stopped and an approved data/reprocessing plan.

Danger

Deleting state.dir, changelog topics, or application offsets is not a generic restart procedure. It can force massive restore traffic, lose state, or replay side effects.

Opt-in transactional state stores can roll back uncommitted changes instead of rebuilding the full store after an error. Confirm the store type and configuration before assuming this recovery behavior.

Restore completes, tasks remain assigned, threads reach RUNNING, changelog lag reaches steady state, stores answer expected queries, transaction errors stop, and output semantics remain correct.

Use persistent fast state volumes, monitor restore time and changelog health, size recovery capacity, preserve stable instance placement where useful, and test loss of one state directory.