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-9842; Add test case for OffsetsForLeaderEpoch grouping in Fetcher #8457

Merged
merged 1 commit into from Apr 14, 2020

Conversation

hachikuji
Copy link
Contributor

This is a follow-up to #8077. The bug exposed a testing gap in how we group partitions. This patch adds a test case which reproduces the reported problem.

Committer Checklist (excluded from commit message)

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

Copy link
Contributor

@mumrah mumrah left a comment

Choose a reason for hiding this comment

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

Looks good to me, just one question about the request matcher

@Override
public boolean matches(AbstractRequest body) {
OffsetsForLeaderEpochRequest request = (OffsetsForLeaderEpochRequest) body;
return expectedPartitions.equals(request.epochsByTopicPartition().keySet());
Copy link
Contributor

Choose a reason for hiding this comment

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

So here we are checking that the request sent from validateOffsetsIfNeeded only includes the partitions whose leader is the current node? If the match fails do we get a nice junit assertion failure, or some funky mockito stack trace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You would get a message like this:

Request matcher did not match next-in-line request {replica_id=-1,topics=[{topic=test,partitions=[{partition=2,current_leader_epoch=5,leader_epoch=4}]}]} with prepared response (type=OffsetsForLeaderEpochResponse, , throttleTimeMs=0, epochEndOffsetsByPartition={test-2=EpochEndOffset{error=NONE, leaderEpoch=4, endOffset=0}})

which I think is reasonable.

@hachikuji hachikuji merged commit 799183b into apache:trunk Apr 14, 2020
hachikuji added a commit that referenced this pull request Apr 14, 2020
…er (#8457)

This is a follow-up to #8077. The bug exposed a testing gap in how we group partitions. This patch adds a test case which reproduces the reported problem.

Reviewers: David Arthur <mumrah@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants