Interview Prep/Real-World Interview/Data loss and corruption

A consumer's offsets were reset to `latest` during a redeploy, and two hours of Kafka events were never processed.

IntermediateTroubleshootingData loss and corruption
Answer

Likely causes → The consumer group changed (a new group.id) or its committed offsets expired (offsets.retention.minutes, default 7 days) while it was down, so auto.offset.reset=latest started from the end and skipped everything in between.

Diagnose →

kafka-consumer-groups.sh --bootstrap-server $BS --describe --group orders-consumer
kafka-consumer-groups.sh --bootstrap-server $BS --list | grep orders

Find the timestamp of the last processed event in the consumer's logs or output data.

Fix → If the messages are still within topic retention, stop the consumer and rewind to that time:

kafka-consumer-groups.sh --bootstrap-server $BS --group orders-consumer --topic orders \
  --reset-offsets --to-datetime 2026-11-09T10:00:00.000 --execute

Make sure processing is idempotent before replaying, since some events will be seen twice.

Prevent → Keep group.id stable in config, choose auto.offset.reset=earliest for consumers that must not lose data, and alert on consumer lag and on groups disappearing.

All Real-World Interview questions Roadmap: Interview readiness

More on Data loss and corruption