KAFKA-12597: remove deprecated zookeeper option in ReassignPartitionsCommand#10471
Conversation
| .withRequiredArg | ||
| .describedAs("Server(s) to use for bootstrapping") | ||
| .ofType(classOf[String]) | ||
| .required() |
There was a problem hiding this comment.
Make bootstrapServerOpt as required
|
@ijuma , could you help review this PR? Thanks. |
ijuma
left a comment
There was a problem hiding this comment.
Thanks for the PR. A few comments below.
| var failed = true | ||
|
|
||
| val props = if (opts.options.has(opts.commandConfigOpt)) | ||
| Utils.loadProps(opts.options.valueOf(opts.commandConfigOpt)) |
There was a problem hiding this comment.
Why was this moved outside the try?
There was a problem hiding this comment.
Good question. The lines I moved out of try block are props setup (which is safe), and Admin.create. I was trying to do try-with-resource in scala, but it can't. I moved the Admin.create back to try block. Thank you.
There was a problem hiding this comment.
Why is props setup safe? It could fail to load the fail, etc.
| println(Utils.stackTrace(e)) | ||
| } finally { | ||
| // Close the AdminClient or ZooKeeper client, as appropriate. | ||
| // Close the AdminClient, as appropriate. |
| @@ -1695,14 +1367,12 @@ object ReassignPartitionsCommand extends Logging { | |||
| opts.bootstrapServerOpt, | |||
There was a problem hiding this comment.
Do we need to pass bootstrapServerOpt here and the lines below?
There was a problem hiding this comment.
Yes, if bootstrapServerOpt is not in the permitted arg list, the check will fail since bootstrapServerOpt is not permitted option for this action.
| def shouldPrintHelpTextIfHelpArg(): Unit = { | ||
| val args: Array[String]= Array( | ||
| "--help", | ||
| "--bootstrap-server", "localhost:1234") |
There was a problem hiding this comment.
Hmm, we should not require this line to see the help text.
There was a problem hiding this comment.
Well, I agree. Making the --bootstrap-server as required argument caused this side effect. I think we should keep the --bootstrap-server as non-required, and do the argument check by ourselves. I'll update it, and also the other PR: #10457 on the ConfigCommand tomorrow. Thank you.
c3666e7 to
b95c713
Compare
|
@ijuma , thanks for the comments. I've updated with:
Thanks. |
|
@ijuma , could you please help review the PR? Thank you. |
|
@ijuma , could you take a look again for this PR? Thanks. |
ijuma
left a comment
There was a problem hiding this comment.
Thanks for the updates, a couple of comments.
| var failed = true | ||
|
|
||
| val props = if (opts.options.has(opts.commandConfigOpt)) | ||
| Utils.loadProps(opts.options.valueOf(opts.commandConfigOpt)) |
There was a problem hiding this comment.
Why is props setup safe? It could fail to load the fail, etc.
| shouldFailWith("You must specify --bootstrap-server when using \"[command-config]\"", args) | ||
| def shouldPrintHelpTextIfHelpArg(): Unit = { | ||
| val args: Array[String]= Array("--help") | ||
| shouldFailWith(ReassignPartitionsCommand.helpText, args) |
There was a problem hiding this comment.
Should this actually fail? It seems that it should succeed, right?
There was a problem hiding this comment.
Yes, it should not fail actually. But we share the same printUsageAndDie method with other wrong argument cases, so it indeed fail in the logic. I think it's OK since user won't feel it's a failed run anyway. I'll add a comment here. Thanks.
|
@ijuma , thanks for the comments. I've updated. Please take a look again. Thank you. |
|
@ijuma , could you help check this PR again? Thanks. |
|
Failed tests are flaky |
ijuma
left a comment
There was a problem hiding this comment.
Thanks for the PR. I left a couple of comments below. In addition, we should add a note to upgrade.html for this removal as well as the topic command one.
| PartitionReassignmentState(Seq(3, 2, 0), Seq(3, 2, 0), true) | ||
| ) | ||
|
|
||
| // When using --zookeeper, we aren't able to see the new-style assignment |
There was a problem hiding this comment.
Since we are removing this comment, should we be using new style assignment?
There was a problem hiding this comment.
This comment is kind of weird here, but as here mentioned:
Warning: because you are using the deprecated --zookeeper option, the results may be incomplete. Use --bootstrap-server instead for more accurate results.
So, I added one more verification here due to we change to adminClient now. The most important finalAssignment is already verified.
Thank you.
There was a problem hiding this comment.
Yeah, I don't know what it means by new-style assignment either.
|
@ijuma , thanks for your comments. I've addressed them and add a note in upgrade.html in this commit: 9215777. For the system tests, I've created another jira ticket to track it: KAFKA-12884. Thank you. |
| <li>The <code>Admin.electedPreferredLeaders()</code> methods were removed. Please use <code>Admin.electLeaders</code> instead.</li> | ||
| <li>The <code>kafka-preferred-replica-election</code> command line tool was removed. Please use <code>kafka-leader-election</code> instead.</li> | ||
| <li>The <code>--zookeeper</code> option was removed from the <code>bin/kafka-topics.sh</code> command line tool. Please use <code>--bootstrap-server</code> instead.</li> | ||
| <li>The <code>--zookeeper</code> option was removed from the <code>bin/kafka-topics.sh</code> and <code>bin/kafka-reassign-partitions.sh</code> command line tool. |
There was a problem hiding this comment.
"command line tool" -> "command line tools"
| PartitionReassignmentState(Seq(3, 2, 0), Seq(3, 2, 0), true) | ||
| ) | ||
|
|
||
| // When using --zookeeper, we aren't able to see the new-style assignment |
There was a problem hiding this comment.
Yeah, I don't know what it means by new-style assignment either.
|
Unrelated test failures:
|
|
Thanks @ijuma , I should have listed all failed tests and verify they are all un-related failure to reduce your review task. Thank you. :) |
…nmentWithAlterIsrDisabled (#11244) Removes assertion added in #10471. It's unsafe to assert that there are partition movements ongoing for some of the tests in the suite because partitions in some of the tests have 0 data, which may complete reassignment before `verify` can run. Tests pass locally. Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>
…nmentWithAlterIsrDisabled (#11244) Removes assertion added in #10471. It's unsafe to assert that there are partition movements ongoing for some of the tests in the suite because partitions in some of the tests have 0 data, which may complete reassignment before `verify` can run. Tests pass locally. Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>
…nmentWithAlterIsrDisabled (apache#11244) Removes assertion added in apache#10471. It's unsafe to assert that there are partition movements ongoing for some of the tests in the suite because partitions in some of the tests have 0 data, which may complete reassignment before `verify` can run. Tests pass locally. Reviewers: Luke Chen <showuon@gmail.com>, Ismael Juma <ismael@juma.me.uk>
remove deprecated
--zookeeperoption in ReassignPartitionsCommand. And also the zookeeper dependent methods, and the tests.Committer Checklist (excluded from commit message)