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-5161: add code in reassign-partitions to check broker existence #2962

Closed

Conversation

huxihx
Copy link
Contributor

@huxihx huxihx commented May 3, 2017

Added code to check existence of the brokers in the proposed plan.

huxihx added 2 commits May 3, 2017 09:54
…uster

Added code for non-existent brokerID checking in the proposed assignemnt plan.
…uster

Added code to check brokerID existence in the proposed assignment plan.
@huxihx
Copy link
Contributor Author

huxihx commented May 3, 2017

@hachikuji Please take some time to review this PR. Thanks.

@asfbot
Copy link

asfbot commented May 3, 2017

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

@asfbot
Copy link

asfbot commented May 3, 2017

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

@asfbot
Copy link

asfbot commented May 3, 2017

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

@huxihx
Copy link
Contributor Author

huxihx commented May 3, 2017

@guozhangwang Please kindly take some time to review this PR. Thanks.

@guozhangwang
Copy link
Contributor

retest this please

@asfbot
Copy link

asfbot commented May 4, 2017

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

@asfbot
Copy link

asfbot commented May 4, 2017

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

@asfbot
Copy link

asfbot commented May 4, 2017

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

Copy link
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

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

Could you update the title to KAFKA-5161: ...

@@ -209,6 +209,12 @@ object ReassignPartitionsCommand extends Logging {
throw new AdminCommandFailedException("The proposed assignment contains non-existent partitions: " +
nonExistentPartitions)

//Check that all brokers in the proposed assignment exist in the cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: once space after // and do not need to capitalize.

@huxihx huxihx changed the title Kafka5161 reassign-partitions to check if broker of ID exists in cluster KAFKA-5161 add code in reassign-partitions to check broker existence May 5, 2017
@huxihx huxihx changed the title KAFKA-5161 add code in reassign-partitions to check broker existence KAFKA-5161: add code in reassign-partitions to check broker existence May 5, 2017
@huxihx
Copy link
Contributor Author

huxihx commented May 5, 2017

@guozhangwang Thanks for the comments and please review again.

@asfbot
Copy link

asfbot commented May 5, 2017

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

@asfbot
Copy link

asfbot commented May 5, 2017

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

@asfbot
Copy link

asfbot commented May 5, 2017

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

@guozhangwang
Copy link
Contributor

Merged to trunk.

@asfgit asfgit closed this in 95b48b1 May 5, 2017
@huxihx huxihx deleted the kafka5161_reassign_check_invalid_brokerID branch May 5, 2017 05:44
val existingBrokerIDs = zkUtils.getSortedBrokerList()
val nonExistingBrokerIDs = partitionsToBeReassigned.toMap.values.flatten.filterNot(existingBrokerIDs.contains).toSet
if (nonExistingBrokerIDs.nonEmpty)
throw new AdminCommandFailedException("The proposed assignment contains non-existent brokerIDs: " + nonExistingBrokerIDs.mkString(","))
Copy link
Contributor

Choose a reason for hiding this comment

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

It would probably be good to be a bit clearer about what non-existent means. A broker that lost connection (maybe due to an upgrade) won't appear in getSortedBrokerList for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants