Commit-Cycle Failure Scenarios, Traced
Linked from Commit-Cycle Failure Scenarios
The Case Worth Studying: Changelog Written, Offset Commit Fails
offset committed at 500
process 501–520 → cache evicts → changelog + RocksDB now reflect 520
consumer.commitSync() FAILS (coordinator unavailable, or a rebalance
fenced this consumer mid-cycle)Streams surfaces this as CommitFailedException → TaskMigratedException: the task is closed and reassigned. Its new owner rebuilds state from the changelog — which already includes 501–520 — and resumes reading input from 500. Those twenty events are processed twice.
The Full Set
| Failure | What survives | Damage |
|---|---|---|
| Crash mid-interval, no commit attempted | Whatever the cache already evicted is in the changelog; the rest is gone | Reprocessing of the evicted portion only. If nothing was evicted, recovery is clean. |
| Offset commit fails after changelog acked | Changelog and output through 520; offset at 500 | Over-counting + duplicate output for 501–520. Silent. |
| Changelog write fails (producer error at step 2) | Only records acked before the error | producer.flush() throws, offsets never commit, the StreamThread dies per uncaught.exception.handler (REPLACE_THREAD by default). Same reprocessing window for what was acked. |
| Crash during restore | .checkpoint was never updated | None. Replay restarts from the last checkpointed changelog offset, and replay is idempotent. |
| Hard kill between the RocksDB write and the changelog send | RocksDB holds orphan writes; changelog does not | Collapses into ordinary reprocessing — the offset is back at the same commit point. See Why There Is No Transaction Here. |
| Zombie writer — see below | Both the zombie and the new owner are writing | State corruption. The worst case, and undetectable. |
The Zombie Writer
An instance stalls on a long GC pause, misses its heartbeats, and gets fenced by a rebalance. A new instance takes over the task. Then the old one wakes up — and under at-least-once its producer was never fenced, only its consumer:
Nothing detects this. It is not bounded by a commit interval, and the corrupted value survives every subsequent restore, because the changelog now genuinely says 150. This is the strongest argument for exactly-once — stronger than duplicate counts.