Skip to content
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

Fetch consumer group metadate after a rebalance #1470

Closed
erikvanoosten opened this issue Feb 17, 2025 · 5 comments · Fixed by #1474
Closed

Fetch consumer group metadate after a rebalance #1470

erikvanoosten opened this issue Feb 17, 2025 · 5 comments · Fixed by #1474

Comments

@erikvanoosten
Copy link
Collaborator

As discussed in #1464 (comment) we can simplify the code that fetches consumer group metadata by fetching it immediately after a rebalance. However, we first need to explore why errors from the call to consumer.groupMetadata() are suppressed, and whether it makes sense to keep retrying after a failure.

This issue is done when:

  • we know if we can ignore errors from consumer.groupMetadata()
  • we know retrying consumer.groupMetadata() is useless
  • if the answer is yes to both, fetching the group metadata was moved to directly after the rebalance
@vermas7988
Copy link
Contributor

vermas7988 commented Feb 17, 2025

the given method consumer.groupMetadata() may return InvalidGroupIdException (see line 1717: KafkaConsumer.java).
It can happen if consumer group id is misconfigured from user's side, and it looks like there is very less we can do from library's perspective. WDYT?

@erikvanoosten
Copy link
Collaborator Author

the given method consumer.groupMetadata() may return InvalidGroupIdException

It depends on what they mean by 'if consumer does not have a group'. We already do not call the method when no group id is configured. Is that sufficient?

@vermas7988
Copy link
Contributor

I read a bit more. So, also, when users don't want to store offsets on kafka, they might not configure consumer groups.

If the Runloop is not crashing because consumer group metadata is None while we received the current event, and we still process the current record/event successfully, it feels safe to make the change.
But hard to take decision, if we are retrying indefinitely on current event when the metadata is not present.

@erikvanoosten
Copy link
Collaborator Author

We're going to make release candidates for zio-kafka 3. We could make the change for the release candidate. Then when no-one complains we can keep it :)

@vermas7988
Copy link
Contributor

okay I will submit a PR

erikvanoosten pushed a commit that referenced this issue Feb 19, 2025
Simplify `Runloop` by fetching consumer group metadata directly after the rebalance.

Fixes #1470.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants