question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Description

Hello,

I have faced with periodical offsets resetting on broker configuration change. Attempts to understand what was going on did not lead me to anything.

Offsets are loosing for one group and keeping for others. I can stable reproduce this behaviour for a single consumer group.

How to reproduce

I have one producer, one consumer, 3 brokers. Producer is constantly writes messages with performance=300 msgs / sec. Consumer is reading messages from topic and commiting offsets of read messages automatically. I monitor consumer latency and lag.

Consumer configuration:

    config["group.id"] = "KafkaTests"; 
    config["statistics.interval.ms"] = 10000;
    config["fetch.message.max.bytes"] = 128000;
    config["queued.max.messages.kbytes"] = 1024;
    config["queued.min.messages"] = 200;
    config["fetch.wait.max.ms"] = 1000;

    config["session.timeout.ms"] = 30000;
    config["offset.store.method"] = "broker";
    config["default.topic.config"] = new Dictionary<string, object>() { { "auto.offset.reset", "smallest" } };
    config["enable.auto.commit"] = "true;

When I shut a single kafka broker down, consumer latency (and lag) is growing up and consumer starts to consume already processed messages second time.

When I turn broker back, lag is usually decreases but not to original value. It might look like this

I don’t understand what’s going on, it looks like broker misconfiguration, but can’t find any relevant information in internet.

You can see log of fetched offsets below:

7|2018-01-29 14:26:22.943|rdkafka#consumer-1|OFFSETFETCH| [thrd:main]:  HttpLogMessage [0] offset INVALID
7|2018-01-29 14:26:22.944|rdkafka#consumer-1|OFFSETFETCH| [thrd:main]: kafka1:9092/1: OffsetFetchResponse: HttpLogMessage [0] offset 2449840
7|2018-01-29 14:27:44.861|rdkafka#consumer-1|OFFSETFETCH| [thrd:main]:  HttpLogMessage [0] offset INVALID
7|2018-01-29 14:27:44.861|rdkafka#consumer-1|OFFSETFETCH| [thrd:main]: kafka2:9092/3: OffsetFetchResponse: HttpLogMessage [0] offset 2346535
7|2018-01-29 14:28:44.347|rdkafka#consumer-1|OFFSETFETCH| [thrd:main]:  HttpLogMessage [0] offset INVALID
7|2018-01-29 14:28:44.347|rdkafka#consumer-1|OFFSETFETCH| [thrd:main]: kafka1:9092/1: OffsetFetchResponse: HttpLogMessage [0] offset 2373064

Please let me know if I should provide more info / logs

Checklist

Please provide the following information:

  • Confluent.Kafka nuget version: 0.11.2
  • Apache Kafka version: 0.10.2
  • Client configuration:
  • Operating system: windows
  • Provide logs (with “debug” : “…” as necessary in configuration)
  • Provide broker log excerpts
  • Critical issue

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
TonyWang666commented, Apr 29, 2021

Check the broker offsets.retention.minutes, it could be that your committed offsets are deleted due to retention policy.

@edenhill Bro, you just saved my life. I have spent 2 days on it without any clues. It turns out that I set retention time to 1 min. Thanks again for the @edenhill and also to question contributor @divan-9.

1reaction
edenhillcommented, Nov 5, 2018

Check the broker offsets.retention.minutes, it could be that your committed offsets are deleted due to retention policy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Offset Loose=No/Yes needs to remember previous setting
Loose offsets are much more clean than the normal ones, ... When you choose the loose option, the resulting curve is not within...
Read more >
Offset lost for OffsetDateTime with Spring Boot REST Service
I am using java OffsetDateTime to store time both on the client and server side. When I am sending the time information to...
Read more >
Offset Loose Cover for the Offset Sofa at Audo | Buy online
The Offset Loose Cover introduces increased longevity, functionality and versatility to the collection, with a removable and washable exterior crafted from ...
Read more >
Offset - Don't Lose Me (Lyrics) - YouTube
Offset - Don't Lose Me (Lyrics). 1M views · 4 years ago ...more. Kevin Gray. 217K. Subscribe. 217K subscribers. 22K. Share. Save. Report ......
Read more >
Z offset lost after shutdown : r/klippers
After every shutdown of my printer, first print i have to adjust my Z-offset. And it is no the same offset as before....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found