FrankYang0529 commented on code in PR #20551:
URL: https://github.com/apache/kafka/pull/20551#discussion_r2365931943
##########
metadata/src/test/java/org/apache/kafka/metadata/storage/FormatterTest.java:
##########
@@ -571,31 +586,25 @@ public void
testFormatWithoutNoInitialControllersFailsWithNewerKraftVersion() th
FormatterContext formatter1 = testEnv.newFormatter();
formatter1.formatter.setFeatureLevel("kraft.version", (short) 1);
formatter1.formatter.setUnstableFeatureVersionsEnabled(true);
- formatter1.formatter.setNoInitialControllersFlag(false);
assertFalse(formatter1.formatter.hasDynamicQuorum());
assertEquals(
- "Cannot set kraft.version to 1 unless one of the flags
--standalone, --initial-controllers, or " +
- "--no-initial-controllers is used. For dynamic controllers
support, try using one of " +
- "--standalone, --initial-controllers, or
--no-initial-controllers.",
+ "Cannot set kraft.version to 1 unless controller.quorum.voters
is empty and " +
+ "one of the flags --standalone, --initial-controllers, or
-no-initial-controllers is used. " +
Review Comment:
ditto
##########
metadata/src/main/java/org/apache/kafka/metadata/storage/Formatter.java:
##########
@@ -348,20 +352,20 @@ private short effectiveKRaftFeatureLevel(Optional<Short>
configuredKRaftVersionL
if (configuredKRaftVersionLevel.get() == 0) {
if (hasDynamicQuorum()) {
throw new FormatterException(
- "Cannot set kraft.version to " +
- configuredKRaftVersionLevel.get() +
- " if one of the flags --standalone,
--initial-controllers, or --no-initial-controllers is used. " +
+ "Cannot set kraft.version to " +
configuredKRaftVersionLevel.get() +
+ " if controller.quorum.voters is empty and one of the
flags --standalone, " +
+ "--initial-controllers, or --no-initial-controllers is
used. " +
"For dynamic controllers support, try removing the
--feature flag for kraft.version."
);
}
} else {
if (!hasDynamicQuorum()) {
throw new FormatterException(
- "Cannot set kraft.version to " +
- configuredKRaftVersionLevel.get() +
- " unless one of the flags --standalone,
--initial-controllers, or --no-initial-controllers is used. " +
- "For dynamic controllers support, try using one of
--standalone, --initial-controllers, or " +
- "--no-initial-controllers."
+ "Cannot set kraft.version to " +
configuredKRaftVersionLevel.get() +
+ " unless controller.quorum.voters is empty and one of
the flags --standalone, " +
+ "--initial-controllers, or -no-initial-controllers is
used. " +
Review Comment:
nit: `-no-initial-controllers` -> `--no-initial-controllers`.
##########
metadata/src/test/java/org/apache/kafka/metadata/storage/FormatterTest.java:
##########
@@ -478,9 +481,10 @@ public void
testFormatWithoutInitialVotersFailsWithNewerKraftVersion() throws Ex
formatter1.formatter.setUnstableFeatureVersionsEnabled(true);
assertFalse(formatter1.formatter.hasDynamicQuorum());
assertEquals(
- "Cannot set kraft.version to 1 unless one of the flags
--standalone, --initial-controllers, or " +
- "--no-initial-controllers is used. For dynamic controllers
support, try using one of " +
- "--standalone, --initial-controllers, or
--no-initial-controllers.",
+ "Cannot set kraft.version to 1 unless controller.quorum.voters
is empty and " +
+ "one of the flags --standalone, --initial-controllers, or
-no-initial-controllers is used. " +
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]