Skip to content

KAFKA-9179; Fix flaky test due to race condition when fetching reassignment state#7786

Merged
hachikuji merged 1 commit into
apache:trunkfrom
hachikuji:KAFKA-9179
Dec 6, 2019
Merged

KAFKA-9179; Fix flaky test due to race condition when fetching reassignment state#7786
hachikuji merged 1 commit into
apache:trunkfrom
hachikuji:KAFKA-9179

Conversation

@hachikuji

@hachikuji hachikuji commented Dec 5, 2019

Copy link
Copy Markdown
Contributor

I see TopicCommandWithAdminClientTest.testDescribeUnderReplicatedPartitionsWhenReassignmentIsInProgress failing locally quite often, probably 30% of the time or more. After investigating, the failures are due to a race condition on reassignment completion. The previous code fetched metadata first and then fetched the reassignment state. It is possible in between those times for the reassignment to complete, which leads to spurious URPs being reported. The fix is to change the order of these checks and to explicitly check for reassignment completion. This is still not a 100% reliable approach because it is also possible for another reassignment to be submitted, but it catches the most likely case.

Committer Checklist (excluded from commit message)

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

@guozhangwang guozhangwang 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!

@hachikuji hachikuji merged commit 1d496a2 into apache:trunk Dec 6, 2019
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