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

KAFKA-4357: Fix consumer group describe output when there is no active member (old consumer) #2075

Closed
wants to merge 1 commit into from

Conversation

vahidhashemian
Copy link
Contributor

No description provided.

Copy link

@harshach harshach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit. Otherwise LGTM.

@@ -83,12 +83,13 @@ object ConsumerGroupCommand extends Logging {
printAssignment(assignments, !opts.useOldConsumer)
case Some("Stable") =>
printAssignment(assignments, !opts.useOldConsumer)
case None =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: any reason to change the ordering here. It's better to have the case None as the last block in here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback. I changed the order so the last one in the list (Some(other)) is the one we should never reach. With None we may still have to do some processing. With that in mind, do you still think None should go to the bottom?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vahidhashemian can you add a comment over there. +1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshach Sure, I assume you mean putting my response above in a code comment above. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little odd to match on the state for old consumer at all since it's always None. Would it make sense to handle the old consumer case separately prior to matching?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll try to do that (separate handling of describe for old and new consumer) later today. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hachikuji I restructured that section of the code. It should address @harshach's concern too. Please let me know if you see issues with the updated code. Thanks.

@vahidhashemian
Copy link
Contributor Author

@hachikuji This is the PR for the bug we discussed (under PR for KAFKA-3853) on Friday. Would appreciate your feedback, and opinion about the comment by @harshach. Thanks.

// A valid state value is required for new consumer only, but this is still a valid case if old consumer is used
if (!opts.useOldConsumer)
throw new KafkaException("Expected a valid consumer group state, but none found.")
printAssignment(assignments, false)
case Some(other) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we should never reach here, maybe we can use case _?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, never mind. It's helpful to know the specific state.

@hachikuji
Copy link
Contributor

LGTM. Not sure what's going on with jenkins, but I'll try to build locally.

@asfgit asfgit closed this in 94909a8 Nov 1, 2016
efeg pushed a commit to efeg/kafka that referenced this pull request May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants