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-7141: ConsumerGroupCommand should describe group assignment eve… #5356

Merged
merged 6 commits into from
Jul 20, 2018

Conversation

huxihx
Copy link
Contributor

@huxihx huxihx commented Jul 11, 2018

…n with no offsets committed.

https://issues.apache.org/jira/browse/KAFKA-7141

Currently, if a consumer group never commits offsets, ConsumerGroupCommand cannot describe it at all even if the member assignment is valid. Instead, the tool should be able to describe the group information showing empty current_offset and LAG.

More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.

Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

…n with no offsets committed.

https://issues.apache.org/jira/browse/KAFKA-7141

Currently, if a consumer group never commits offsets, ConsumerGroupCommand cannot describe it at all even if the member assignment is valid. Instead, the tool should be able to describe the group information showing empty current_offset and LAG.
@huxihx
Copy link
Contributor Author

huxihx commented Jul 12, 2018

@vahidhashemian Please review this patch. Thanks.

@huxihx
Copy link
Contributor Author

huxihx commented Jul 12, 2018

retest it please.

Copy link
Contributor

@vahidhashemian vahidhashemian left a comment

Choose a reason for hiding this comment

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

@huxihx thanks for making this improvement. I just had a minor comment inline. Otherwise, LGTM.

abstract class AbstractConsumerRunnable(broker: String, groupId: String) extends Runnable {
val props = new Properties
abstract class AbstractConsumerRunnable(broker: String, groupId: String, customPropsOpt: Option[Properties] = None) extends Runnable {
val props = if (customPropsOpt.isDefined) new Properties(customPropsOpt.get) else new Properties
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to move this line after configure(props) below so we also provide a way to override the default configs? In other words, this line would remain unchanged, and after configure(props) we add

    if (customPropsOpt.isDefined)
      props.putAll(customPropsOpt.get)

@huxihx
Copy link
Contributor Author

huxihx commented Jul 13, 2018

@vahidhashemian Thanks for the comments, please review again.
@hachikuji Please review.

@vahidhashemian
Copy link
Contributor

LGTM, thanks for addressing my comment.

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.

+1

@huxihx
Copy link
Contributor Author

huxihx commented Jul 18, 2018

@hachikuji Could you take some time to review this patch? Thanks.

@hachikuji
Copy link

hachikuji commented Jul 18, 2018

With Vahid's previous KIP, I think the intention is that the default behavior of --describe is the same as --describe --offsets, so I'm wondering if the behavior is actually reasonable. We also have --describe --members which can be used to see the members in the group. Thoughts?

@vahidhashemian
Copy link
Contributor

I think this PR fixes the situation where consumers have joined the group but have not committed any offset yet. Current implementation does not report any rows until they commit offsets, which I think does not provide a good user experience. It seems to me that this PR still follows the definition of --describe and --describe --offsets in KIP-175

The output of --describe will change to return one row per topic partition in the group. This means that group members with no assigned partition will not be present in the default output.

Please advise if I'm missing something.

@hachikuji
Copy link

Ok, that makes sense.

Copy link

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

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

Left a trivial comment, but otherwise LGTM. Thanks!

val props = new Properties
configure(props)
if (customPropsOpt.isDefined)

Choose a reason for hiding this comment

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

nit: use foreach

@huxihx
Copy link
Contributor Author

huxihx commented Jul 19, 2018

@hachikuji Thanks for the comments. Please review again.

@huxihx
Copy link
Contributor Author

huxihx commented Jul 19, 2018

retest it please.

Copy link

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

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

LGTM

@hachikuji
Copy link

retest this please

@hachikuji
Copy link

Thanks @huxihx. I will merge in the morning after the build finishes.

@hachikuji
Copy link

retest this please

1 similar comment
@hachikuji
Copy link

retest this please

@asfgit
Copy link

asfgit commented Jul 19, 2018

FAILURE
9284 tests run, 5 skipped, 3 failed.
--none--

@hachikuji
Copy link

@huxihx The build failure on jdk10 seems deterministic. Can you look into it?

@huxihx
Copy link
Contributor Author

huxihx commented Jul 20, 2018

@hachikuji Seems it hit a known Scala bug opened by Ijuma (scala/bug#10418). I will take care of it.

@huxihx
Copy link
Contributor Author

huxihx commented Jul 20, 2018

retest this please

@hachikuji hachikuji merged commit bf237fa into apache:trunk Jul 20, 2018
@hachikuji
Copy link

@huxihx Thanks for fixing the issue. Merged to trunk.

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.

5 participants