-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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-14593: Move LeaderElectionCommand to tools #13204
Conversation
5828376
to
8b8c1f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @OmniaGM, thanks for working on this.
I think you need to rebase, as I get lots of checkstyle errors that seems unrelated to your changes.
Then, I leaved some comments and suggestions.
build.gradle
Outdated
@@ -1756,6 +1756,7 @@ project(':tools') { | |||
|
|||
dependencies { | |||
implementation project(':clients') | |||
implementation project(':core') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The direction from previous migrations is that we don't want to depend on core. I see there are a few kafka.* dependencies in LeaderElectionCommand class. Do you think we can also migrate them as part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be bit harder to move them to tools. For example the command uses kafka.utils.json
which is used by kafka.server
, kafka.security.authorizer
. And kafka.admin.AdminOperationException
is used by kafka.admin
, kafka.controller
, kafka.zk
, etc. So not sure it's easy to move them out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These classes may be candidates to land in the module server-common
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid making tools depend on core if possible. I opened https://issues.apache.org/jira/browse/KAFKA-14737 to move the kafka.utils.json classes to server-common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the dependencies on the core now. Out of curiosity do we plan to move kafka.utils.TestUtils
out of core and maybe into common at some point?
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandTest.java
Show resolved
Hide resolved
bd21b9d
to
817730d
Compare
This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please ask a committer for review. If the PR has merge conflicts, please update it with the latest from trunk (or appropriate release branch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @OmniaGM, thanks. I left few minor comments, but I think we are almost there with this.
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandErrorTest.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. It looks good overall, I left a few suggestions to cleanup some logic.
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandTest.java
Outdated
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandTest.java
Outdated
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandTest.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandErrorTest.java
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandTest.java
Outdated
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandTest.java
Show resolved
Hide resolved
tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandTest.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java
Outdated
Show resolved
Hide resolved
b2bcafd
to
638f48a
Compare
The test is failing because of an unrelated package |
I've re-kicked a build, hopefully that will clear the test failures. |
Still with all the |
I will have a look into the |
@mimaison I can't reproduce the problem locally. I ran |
To be honest, I'm not sure. Try rebasing on trunk. Maybe there's a conflict with a recent commit. |
e0f51e5
to
926dec0
Compare
I managed to reproduce some of the failed tests locally. Seems like any test that includes shutting down a broker and bringing it back up causes an odd situation where the leader of the topic shrinks the ISR to itself even though there is another replica online. So far the only thing I'm noticing is that every time the test restarts a broker it gets these 2 errors
and
Am not sure what changed but the broker is failing to start |
926dec0
to
867768d
Compare
I found out why the tests were failing because we are hitting a similar problem to this gradle issue#847 that causing transitive dependency problems where |
The test is failing for different packages https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-13204/19/testReport/ and one of the tasks succeeded in building but failed with an error
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and for figuring out the dependency issue. LGTM
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Federico Valeri <fedevaleri@gmail.com>
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Federico Valeri <fedevaleri@gmail.com>
Committer Checklist (excluded from commit message)