-
Notifications
You must be signed in to change notification settings - Fork 14.7k
KAFKA-19719: --no-initial-controllers should not assume kraft.version=1 #20604
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,21 +135,30 @@ object StorageTool extends Logging { | |
featureNamesAndLevels(_).foreachEntry { | ||
(k, v) => formatter.setFeatureLevel(k, v) | ||
}) | ||
Option(namespace.getString("initial_controllers")). | ||
val initialControllers = namespace.getString("initial_controllers") | ||
val isStandalone = namespace.getBoolean("standalone") | ||
val staticVotersEmpty = config.quorumConfig.voters().isEmpty | ||
formatter.setHasDynamicQuorum(staticVotersEmpty) | ||
if (!staticVotersEmpty && (Option(initialControllers).isDefined || isStandalone)) { | ||
throw new TerseFailure("You cannot specify " + | ||
QuorumConfig.QUORUM_VOTERS_CONFIG + " and format the node " + | ||
"with --initial-controllers or --standalone. " + | ||
"If you want to use dynamic quorum, please remove " + | ||
QuorumConfig.QUORUM_VOTERS_CONFIG + " and specify " + | ||
QuorumConfig.QUORUM_BOOTSTRAP_SERVERS_CONFIG + " instead.") | ||
} | ||
Option(initialControllers). | ||
foreach(v => formatter.setInitialControllers(DynamicVoters.parse(v))) | ||
if (namespace.getBoolean("standalone")) { | ||
if (isStandalone) { | ||
formatter.setInitialControllers(createStandaloneDynamicVoters(config)) | ||
} | ||
if (namespace.getBoolean("no_initial_controllers")) { | ||
formatter.setNoInitialControllersFlag(true) | ||
} else { | ||
if (config.processRoles.contains(ProcessRole.ControllerRole)) { | ||
if (config.quorumConfig.voters().isEmpty && formatter.initialVoters().isEmpty) { | ||
if (!namespace.getBoolean("no_initial_controllers") && | ||
config.processRoles.contains(ProcessRole.ControllerRole) && | ||
staticVotersEmpty && | ||
formatter.initialVoters().isEmpty) { | ||
throw new TerseFailure("Because " + QuorumConfig.QUORUM_VOTERS_CONFIG + | ||
" is not set on this controller, you must specify one of the following: " + | ||
"--standalone, --initial-controllers, or --no-initial-controllers."); | ||
} | ||
} | ||
} | ||
Option(namespace.getList("add_scram")). | ||
foreach(scramArgs => formatter.setScramArguments(scramArgs.asInstanceOf[util.List[String]])) | ||
|
@@ -319,18 +328,21 @@ object StorageTool extends Logging { | |
|
||
val reconfigurableQuorumOptions = formatParser.addMutuallyExclusiveGroup() | ||
reconfigurableQuorumOptions.addArgument("--standalone", "-s") | ||
.help("Used to initialize a controller as a single-node dynamic quorum.") | ||
.help("Used to initialize a controller as a single-node dynamic quorum. When setting this flag, " + | ||
"the controller.quorum.voters config must not be set, and controller.quorum.bootstrap.servers is set instead.") | ||
.action(storeTrue()) | ||
|
||
reconfigurableQuorumOptions.addArgument("--no-initial-controllers", "-N") | ||
.help("Used to initialize a server without a dynamic quorum topology.") | ||
.help("Used to initialize a server without specifying a dynamic quorum. When setting this flag, " + | ||
"the controller.quorum.voters config should not be set, and controller.quorum.bootstrap.servers is set instead.") | ||
.action(storeTrue()) | ||
|
||
reconfigurableQuorumOptions.addArgument("--initial-controllers", "-I") | ||
.help("Used to initialize a server with a specific dynamic quorum topology. The argument " + | ||
.help("Used to initialize a server with the specified dynamic quorum. The argument " + | ||
"is a comma-separated list of id@hostname:port:directory. The same values must be used to " + | ||
"format all nodes. For example:\[email protected]:8082:JEXY6aqzQY-32P5TStzaFg,[email protected]:8083:" + | ||
"MvDxzVmcRsaTz33bUuRU6A,[email protected]:8084:07R5amHmR32VDA6jHkGbTA\n") | ||
"MvDxzVmcRsaTz33bUuRU6A,[email protected]:8084:07R5amHmR32VDA6jHkGbTA\n. When setting this flag, " + | ||
"the controller.quorum.voters config must not be set, and controller.quorum.bootstrap.servers is set instead.") | ||
.action(store()) | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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’ve cherry-picked #20532 and #20401 to 4.1, so backporting should be easier now
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, I fixed the conflict in this file.