Skip to content

KAFKA-6773; Allow offset commit/fetch/describe with empty groupId#4851

Merged
hachikuji merged 6 commits intoapache:trunkfrom
hachikuji:KAFKA-6773
Apr 11, 2018
Merged

KAFKA-6773; Allow offset commit/fetch/describe with empty groupId#4851
hachikuji merged 6 commits intoapache:trunkfrom
hachikuji:KAFKA-6773

Conversation

@hachikuji
Copy link
Copy Markdown
Contributor

We had a regression in #4788 which caused the offset commit/fetch/describe APIs to fail if the groupId was empty. This should be allowed for backwards compatibility. I've added a test case to ensure that we do not miss this again in the future.

Committer Checklist (excluded from commit message)

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

Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of minor comments.

val groupId = ""

val commitOffsetResult = commitOffsets(groupId, OffsetCommitRequest.DEFAULT_MEMBER_ID,
OffsetCommitRequest.DEFAULT_GENERATION_ID, immutable.Map(tp -> offset))
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.

Nit: why do we need immutable.?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's because we import scala.collection._. Will try to fix.

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.

Makes sense. You can leave it as is, I was just curious.


private def validateGroup(groupId: String): Option[Errors] = {
if (!validGroupId(groupId))
private def validateNonEmptyGroupStatus(groupId: String): Option[Errors] = {
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.

Can we add a comment saying that this is only used by commit and fetch and why?

@hachikuji
Copy link
Copy Markdown
Contributor Author

@ijuma Thanks, you should probably take another look before I merge since I changed a few things. I had initially not allowed support for the empty group id in DeleteGroups.

Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

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

Just a trivial comment, LGTM (no need for re-review).


@Test
def testCommitAndFetchOffsetsWithEmptyGroup() {
// For backwards compatibility, the coordinator supports committing/fetching offsets with an empty groupId
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.

Do you want to mention the reason for describe/delete group in the test as well?

@hachikuji hachikuji merged commit 7421f9d into apache:trunk Apr 11, 2018
koqizhao pushed a commit to koqizhao/kafka that referenced this pull request Apr 12, 2018
…pId (apache#4851)

We had a regression in apache#4788 which caused the offset commit/fetch/describe APIs to fail if the groupId was empty. This should be allowed for backwards compatibility. Additionally, I have modified DeleteGroups to allow removal of the empty group, which was missed in the initial implementation. I've added a test case to ensure that we do not miss this again in the future.

Reviewers: Ismael Juma <ismael@juma.me.uk>
koqizhao pushed a commit to koqizhao/kafka that referenced this pull request Apr 12, 2018
…pId (apache#4851)

We had a regression in apache#4788 which caused the offset commit/fetch/describe APIs to fail if the groupId was empty. This should be allowed for backwards compatibility. Additionally, I have modified DeleteGroups to allow removal of the empty group, which was missed in the initial implementation. I've added a test case to ensure that we do not miss this again in the future.

Reviewers: Ismael Juma <ismael@juma.me.uk>
koqizhao pushed a commit to koqizhao/kafka that referenced this pull request Apr 12, 2018
…pId (apache#4851)

We had a regression in apache#4788 which caused the offset commit/fetch/describe APIs to fail if the groupId was empty. This should be allowed for backwards compatibility. Additionally, I have modified DeleteGroups to allow removal of the empty group, which was missed in the initial implementation. I've added a test case to ensure that we do not miss this again in the future.

Reviewers: Ismael Juma <ismael@juma.me.uk>
ying-zheng pushed a commit to ying-zheng/kafka that referenced this pull request Jul 6, 2018
…pId (apache#4851)

We had a regression in apache#4788 which caused the offset commit/fetch/describe APIs to fail if the groupId was empty. This should be allowed for backwards compatibility. Additionally, I have modified DeleteGroups to allow removal of the empty group, which was missed in the initial implementation. I've added a test case to ensure that we do not miss this again in the future.

Reviewers: Ismael Juma <ismael@juma.me.uk>
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.

2 participants