New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Consumer group behavior related to session.timeout.ms and offset store API #1817
Comments
To stay in the group a member must send Heartbeat requests at least every < session.timeout.ms (but typically session.timeout.ms/3). This is also fixed in KIP-62 by separating the maximum processing time (added Now back to librdkafka: So in your case you will need to increase session.timeout.ms to match your processing time, at the expense of longer dead member detection and rebalancing times. |
Dup of #1039 (but discussion may forego here) |
Thanks for explaining this. That confirms what I thought was meant to happen, but to my surprise, it doesn't. So my question could be rephrased to the following:
|
That will only happen if the group rebalances and partitions are reassigned to other group members while you are processing a message, and it should typically only affect the single message that is being processed. |
I think I get it now. So in the following scenario:
Is that right? |
yes, and consumer#1 might be unable to commit the processed message because the partition is assigned to consumer#2. |
Thanks a lot! It all makes sense now. Closing this. |
Description
This is more of a question than an actual issue. I'm using the confluent-kafka-go v0.11.4 driver but I believe this is more relevant to librdkafka itself.
I'm trying to understand what happens in a scenario where the process of a message takes more than
session.timeout.ms
in conjunction with the offset store API.I'm testing the following scenario:
I spawn the consumers, they all get assigned a partition as I can observe from
kafka-consumer-groups --describe
and then produce one message.One of the consumers receives the message normally. I try to produce further messages and they are indeed all received by the respective consumers.
kafka-consumer-groups --describe
show each consumer in the latest offset (so lag=0). So everything seems fine, but is it?My question is: shouldn't this scenario cause the same message to be re-processed again and again in an endless loop, since it takes more than
session.timeout.ms
to process message AND commit the offset?I'd expect that the consumer is kicked out of the group, since it does more than
session.timeout.ms
toPoll()
orcommit_offset()
, and so the same partition/message should be give to one of the other consumers. In other words, I'd expect the consumer group to spin endlessly.Probably I'm missing something here and my understanding is just wrong.
librdkafka logs
With
debug=cgrp
:Checklist
Please provide the following information:
0.11.4
0.11.0.2
macOS 10.13.3 (High Sierra)
debug=cgrp
as necessary) from librdkafkaThe text was updated successfully, but these errors were encountered: