confluent-kafka-go: offset reset (at offset 1111) to BEGINNING: fetch failed due to requested offset not available on the broker: Broker: Offset out of range
Description
Hi, master. I encountered an offset reset problem and reported this error, how can I solve it? thanks
How to reproduce
Checklist
Please provide the following information:
- confluent-kafka-go and librdkafka version (
LibraryVersion()): - Apache Kafka broker version:
- Client configuration:
ConfigMap{...} - Operating system:
- Provide client logs (with
"debug": ".."as necessary) - Provide broker log excerpts
- Critical issue
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 34 (10 by maintainers)
@shubhang93 , thanks for your response.
Since you simulated an invalid offset, so the
Broker: Offset out of rangeis expected, right?Before starting my consumer. This is the offset snapshot on my broker
I expect my assigned offsets to be
44,61 and 38respectively. To simulate an invalid offset I will set all my offsets to2000using theconsumer.AssignGoing to start the consumer now
Logs upon starting the consumer with debug
allBroker snapshot after running the consumer
Now running the consumer with
auto.offset.reset=earliest. This works the consumer sets its offset to0and starts to consume hence the current offset is at 2Consumer logs for the same
I don’t think retention should make offsets reset back, afaik they’re monotonical and always increase.
If the committed offset is higher than the hwmark it means the topic (or partition) was removed and re-created, which also means that any committed offsets are invalid (even if their offsets exist they refer to the wrong message).
Your best bet when deleting and re-creating topics is to also delete all committed offsets for that topic, across all groups, using the (java) Admin API.
how do you solve?
We have the same error with 1.9.2 and config:
Can you please add “debug” : “all” to your consumer config and provide the debug logs?