Skip to content

KAFKA-5600: fix GroupMetadataManager doesn't read offsets of segmente… - #3538

Closed
bjrke wants to merge 1 commit into
apache:trunkfrom
justsocialapps:trunk
Closed

bjrke wants to merge 1 commit into
apache:trunkfrom
justsocialapps:trunk

Conversation

@bjrke

@bjrke bjrke commented Jul 17, 2017

Copy link
Copy Markdown

…d log correctly

the while loop was too big and need to be closed earlier
to see the fix, ignore whitespace since most of it is indentation

this bug was introduced by commit
5bd06f1

@ijuma

ijuma commented Jul 17, 2017

Copy link
Copy Markdown
Member

Thanks for finding this and providing a fix. Do you think you'd be able to write a test for this? If not, we can try and help.

@bjrke

bjrke commented Jul 17, 2017

Copy link
Copy Markdown
Author

I am currently trying to write a test, but it will take some time, since I am not very familiar with Easymock and the kafka code.

@asfgit

asfgit commented Jul 17, 2017

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6117/
Test PASSed (JDK 7 and Scala 2.11).

@bjrke

bjrke commented Jul 17, 2017

Copy link
Copy Markdown
Author

here is the test

@asfgit

asfgit commented Jul 17, 2017

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6121/
Test PASSed (JDK 7 and Scala 2.11).

@asfgit

asfgit commented Jul 17, 2017

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6106/
Test PASSed (JDK 8 and Scala 2.12).

@ijuma ijuma left a comment

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.

Thanks for the test. I left some minor comments, but looks good overall. It will be good for @hachikuji to review this as well.

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 you please document what this method returns?

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.

What happened here without the fix?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

is this a question to answer here or to be documented in code?
without the fix, another leader would be elected ("a"), the member Set is different(Set("a") and the offset is 23L

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.

It was just for my own benefit, thanks.

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.

It might be nice to include more partitions in the segments to help catch other regressions in the future. We could, for example, have 2 partitions in segment 1 and 3 partitions in segment 2.

…d log correctly

the while loop was too big and need to be closed earlier
to see the fix, ignore whitespace since most of it is indentation

this bug was introduced by commit
5bd06f1

@ijuma ijuma left a comment

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.

Thanks for the updates, LGTM.

@asfgit

asfgit commented Jul 17, 2017

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/6123/
Test PASSed (JDK 7 and Scala 2.11).

}
}

@Test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for catching this. Just one clarification. It seems the bug is not actually dependent on reading from multiple segments. Multiple reads within the same segment could also cause the issue (which I'm guessing is this line: https://github.com/apache/kafka/pull/3538/files#diff-47448559499d691a7c286fa29d5b202dR600).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

of course, but it is more persistent and reproducable on the segment boundary

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That seems debatable since the cleaner will kick in for older segments. In any case, if the underlying issue is more general, we should probably update the JIRA and PR titles.

@bjrke bjrke Jul 17, 2017 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't want to debate, I want this to be fixed, because we have this issue on some of our systems. I will change issue title, commit message and PR title tomorow morning, but I think it is too complicated to reproduce the single segment multiple read case (unit test case is the same).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can reword the title when we merge if that is acceptable. I just want to make the issue clear for users who encounter it.

@asfgit

asfgit commented Jul 17, 2017

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/6108/
Test PASSed (JDK 8 and Scala 2.12).

@hachikuji hachikuji left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. I will merge to trunk and 0.11.0 with a more general commit title.

@asfgit asfgit closed this in e2fe19d Jul 17, 2017
asfgit pushed a commit that referenced this pull request Jul 17, 2017
…t cache

the while loop was too big and need to be closed earlier
to see the fix, ignore whitespace since most of it is indentation

this bug was introduced by commit
5bd06f1

Author: Jan Burkhardt <[email protected]>

Reviewers: Ismael Juma <[email protected]>, Jason Gustafson <[email protected]>

Closes #3538 from bjrke/trunk

(cherry picked from commit e2fe19d)
Signed-off-by: Jason Gustafson <[email protected]>
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.

4 participants