Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

consumer: consumer group cannot automatically fetch newly-added partitions #2562

Closed
napallday opened this issue Aug 5, 2023 · 0 comments · Fixed by #2563
Closed

consumer: consumer group cannot automatically fetch newly-added partitions #2562

napallday opened this issue Aug 5, 2023 · 0 comments · Fixed by #2563

Comments

@napallday
Copy link
Contributor

napallday commented Aug 5, 2023

Versions

Please specify real version numbers or git SHAs, not just "Latest" since that changes fairly regularly.

Sarama Kafka Go
v1.40.1
Configuration

What configuration values are you using for Sarama and Kafka?

Logs

When filing an issue please provide logs from Sarama and Kafka if at all
possible. You can set sarama.Logger to a log.Logger to capture Sarama debug
output.

logs: CLICK ME

Problem Description

The fix #1525 hasn't completely fixed the problem.

And the issue can be reproduced easily(A functional test is provided in the fix #2563):

  1. Set config.Metadata.RefreshFrequency = 10 * time.Second(to trigger the checking logic in loopCheckPartitionNumbers more frequently)
  2. Two consumer c1 and c2 subscribe to t1p0 and t2p0 respectively in the same consumer group.
  3. Let's say if c1 is the leader, after adding a new partition in t2p1, the new partition cannot be fetched until restart.

The root cause is that:

  1. Although loopCheckPartitionNumbers in c2 will detect the new partition t2p1 and try to send JoinGroupRequest to the server, the server won't trigger a rebalance because c2 is not the leader, and will just return the previous assignment to c2.
  2. Although c1 is the leader, goroutine loopCheckPartitionNumbers still won't exit to trigger a rebalance, because it will only check the topics it subscribes to instead of all the subscribed topics in the consumer group.
@napallday napallday changed the title consumer group cannot automatically fetch newly-added partitions consumer: consumer group cannot automatically fetch newly-added partitions Aug 5, 2023
@dnwe dnwe closed this as completed in #2563 Aug 5, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant