Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

[WIP] Fix GroupMetadataManager::removeProducerGroup() by using the correct ID#1401

Open
ZiyaoWei wants to merge 1 commit into
masterfrom
wzy-group-remove-producerId
Open

[WIP] Fix GroupMetadataManager::removeProducerGroup() by using the correct ID#1401
ZiyaoWei wants to merge 1 commit into
masterfrom
wzy-group-remove-producerId

Conversation

@ZiyaoWei
Copy link
Copy Markdown
Contributor

@ZiyaoWei ZiyaoWei commented Jul 13, 2022

Motivation

GroupMetadataManager::removeProducerGroup() is trying to remove a group using the producerId.

Modifications

Fixed the issue by using the group ID.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

WIP

Documentation

Check the box below.

Need to update docs?

  • no-need-doc

    No functionality change

@github-actions
Copy link
Copy Markdown

@ZiyaoWei:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions github-actions Bot added the doc-info-missing This pr needs to mark a document option in description label Jul 13, 2022
@ZiyaoWei ZiyaoWei changed the title Fix GroupMetadataManager::removeProducerGroup() by using the correct ID [WIP] Fix GroupMetadataManager::removeProducerGroup() by using the correct ID Jul 13, 2022
@github-actions
Copy link
Copy Markdown

@ZiyaoWei:Thanks for providing doc info!

@github-actions github-actions Bot added no-need-doc This pr does not need any document and removed doc-info-missing This pr needs to mark a document option in description labels Jul 13, 2022
@ZiyaoWei ZiyaoWei force-pushed the wzy-group-remove-producerId branch from 85b344f to d7ee08d Compare July 13, 2022 02:25
BewareMyPower pushed a commit that referenced this pull request Jul 13, 2022
### Motivation

Fix linting errors and clean up all the things for the files missed in #1393. These warnings also masked #1401 which fixes a bug.

### Modifications

Fix the linter warnings.
@ZiyaoWei ZiyaoWei force-pushed the wzy-group-remove-producerId branch from d7ee08d to 7eca2a6 Compare July 13, 2022 15:40
BewareMyPower pushed a commit that referenced this pull request Jul 15, 2022
### Motivation

Fix linting errors and clean up all the things for the files missed in #1393. These warnings also masked #1401 which fixes a bug.

### Modifications

Fix the linter warnings.

(cherry picked from commit 6f0ecc3)
BewareMyPower pushed a commit that referenced this pull request Jul 19, 2022
### Motivation

Fix linting errors and clean up all the things for the files missed in #1393. These warnings also masked #1401 which fixes a bug.

### Modifications

Fix the linter warnings.

(cherry picked from commit 6f0ecc3)
BewareMyPower pushed a commit that referenced this pull request Jul 20, 2022
### Motivation

Fix linting errors and clean up all the things for the files missed in #1393. These warnings also masked #1401 which fixes a bug.

### Modifications

Fix the linter warnings.

(cherry picked from commit 6f0ecc3)
@BewareMyPower
Copy link
Copy Markdown
Collaborator

Is it ready to review? If yes, you can remove the "WIP" from the title.

@lin-zhao
Copy link
Copy Markdown

This PR is old. Is it still needed?

@BewareMyPower
Copy link
Copy Markdown
Collaborator

BewareMyPower commented Sep 20, 2022

@lin-zhao I think yes.

@ZiyaoWei Could you rebase it to master again? I think it should be ready to review.

@@ -673,7 +673,7 @@ private void removeProducerGroup(long producerId,
}
}
openGroupsForProducer.computeIfAbsent(producerId, (pid) -> new HashSet<>())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we replace the code like this?

openGroupsForProducer.computeIfAbsent(producerId, (pid) -> new HashSet<>())
    .remove(groupId);
if (openGroupsForProducer.get(producerId).isEmpty()) {
    openGroupsForProducer.remove(producerId);
}

See https://github.com/apache/kafka/blob/8f5c2342244603cea142a2d9d04ba01aa8e14bc6/core/src/main/scala/kafka/coordinator/group/GroupMetadataManager.scala#L950-L954

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ZiyaoWei
Copy link
Copy Markdown
Contributor Author

Will update it - definitely still useful, but it is a bit tricky to find a good way to test the change. I think I'll try to get this merged first and then figure out how to test it, will add a TODO comment.

michaeljmarshall pushed a commit to michaeljmarshall/kop that referenced this pull request Dec 13, 2022
…eamnative#1400)

### Motivation

Fix linting errors and clean up all the things for the files missed in streamnative#1393. These warnings also masked streamnative#1401 which fixes a bug.

### Modifications

Fix the linter warnings.

(cherry picked from commit 6f0ecc3)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-need-doc This pr does not need any document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants