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.
More on Data loss and corruption
An engineer ran `DELETE FROM orders;` on the production Postgres (forgot the `WHERE`) at 14:32.BeginnerA cleanup script deleted every object under `s3://acme-invoices/2025/`. Versioning is enabled.BeginnerYou need to restore last night's MySQL backup and discover the dump files for the past three months are 20 KB each.IntermediateUsers update their profile, the page reloads, and they see the old values; a minute later the new values show up.IntermediateA network partition between data centres lasted 4 minutes; afterwards you find both sites accepted writes as primary, and the same order IDs exist with different contents.AdvancedA deploy ran a migration that dropped the `phone` column; old pods still running during the rolling update threw 500s, and a background job wrote nulls into a new table.Intermediate