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-17465: Make getMembersFromGroup be non-blocking #17080

Merged
merged 10 commits into from
Sep 24, 2024

Conversation

TaiJuWu
Copy link
Contributor

@TaiJuWu TaiJuWu commented Sep 4, 2024

Jira: https://issues.apache.org/jira/browse/KAFKA-17465

Committer Checklist (excluded from commit message)

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

@TaiJuWu TaiJuWu changed the title [Draft] KAFKA-17456 KAFKA-17456: Make getMembersFromGroup be non-blocking Sep 4, 2024
@TaiJuWu TaiJuWu marked this pull request as ready for review September 4, 2024 09:23
Copy link
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

Hi @TaiJuWu
I have few comments, PTAL

@frankvicky
Copy link
Contributor

@TaiJuWu
Please fix the PR title, correct JIRA number is 17465

@TaiJuWu TaiJuWu changed the title KAFKA-17456: Make getMembersFromGroup be non-blocking KAFKA-17465: Make getMembersFromGroup be non-blocking Sep 4, 2024
@TaiJuWu
Copy link
Contributor Author

TaiJuWu commented Sep 4, 2024

@TaiJuWu Please fix the PR title, correct JIRA number is 17465

Thanks for your remainder, I will address your comments later.

@TaiJuWu
Copy link
Contributor Author

TaiJuWu commented Sep 4, 2024

Hi @TaiJuWu I have few comments, PTAL

Hi @frankvicky ,thanks for review, all comments are addressed.

Copy link
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@TaiJuWu thanks for your updates. a couple of comments are left.

} else {
memberIdentity.setMemberId(member.consumerId());
List<MemberIdentity> membersToRemove = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please initialize the size by res.members()?

memberIdentity.setMemberId(member.consumerId());
List<MemberIdentity> membersToRemove = new ArrayList<>();
for (final MemberDescription member : res.members()) {
MemberIdentity memberIdentity = new MemberIdentity().setReason(reason);
Copy link
Contributor

Choose a reason for hiding this comment

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

If you prefer to use lambda function, please try to eliminate the local variable. for example:`

                    membersToRemove.add(member.groupInstanceId()
                            .map(id -> new MemberIdentity().setGroupInstanceId(id))
                            .orElseGet(() -> new MemberIdentity().setMemberId(member.consumerId()))
                            .setReason(reason));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @chia7712 , thanks for review.
I rewrite this part, please take a look.

Copy link
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

Thanks for update.
I have some comments.

RemoveMembersFromConsumerGroupHandler.newFuture(groupId);

KafkaFutureImpl<List<MemberIdentity>> f;
if (options.removeAll()) f = getMembersFromGroup(groupId, reason);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I would recommend not omitting the curly braces, or at the very least, it should break the line.

final SimpleAdminApiFuture<CoordinatorKey, Map<MemberIdentity, Errors>> future =
RemoveMembersFromConsumerGroupHandler.newFuture(groupId);

KafkaFutureImpl<List<MemberIdentity>> f;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename this variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All comments are addressed, thanks!

@chia7712 chia7712 merged commit 2bb9f53 into apache:trunk Sep 24, 2024
9 of 10 checks passed
@TaiJuWu TaiJuWu deleted the async branch September 24, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants