Skip to content

KAFKA-12284: wait for mm2 auto-created the topic#10185

Merged
mimaison merged 2 commits into
apache:trunkfrom
showuon:KAFKA-12284
Mar 3, 2021
Merged

KAFKA-12284: wait for mm2 auto-created the topic#10185
mimaison merged 2 commits into
apache:trunkfrom
showuon:KAFKA-12284

Conversation

@showuon

@showuon showuon commented Feb 23, 2021

Copy link
Copy Markdown
Member

The reason why the test sometimes failed with: TopicExistsException: Topic 'primary.test-topic-2' already exists. is because we tried to create the topic that the MM2 already help us created. That is,

primary.kafka().createTopic("test-topic-2", NUM_PARTITIONS);
// after the primary cluster created "test-topic-2" topic, the backup cluster will auto-created the topic: "primary.test-topic-2" for us
backup.kafka().createTopic("primary.test-topic-2", 1); // this line will have race condition with the MM2

Note: after MM2 replicate the topic, the topic partition number will also get increased to the NUM_PARTITIONS in the end. So, we should just let MM2 help us create topic. Also fix 2 issues in the tests:

  1. We had resource leak due to no close the adminClient

Committer Checklist (excluded from commit message)

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

@showuon

showuon commented Feb 23, 2021

Copy link
Copy Markdown
Member Author

@mimaison , could you help review this PR? Thank you.

@showuon

showuon commented Feb 27, 2021

Copy link
Copy Markdown
Member Author

@mimaison , thanks for your comments. I've addressed them and updated in this commit: de95286. Please review again. Thank you.

@mimaison mimaison 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 PR. LGTM

@mimaison
mimaison merged commit f692963 into apache:trunk Mar 3, 2021
@showuon
showuon deleted the KAFKA-12284 branch April 15, 2021 07:00
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