IGNITE-26748 Add rolling upgrade commands for control.sh#12494
IGNITE-26748 Add rolling upgrade commands for control.sh#12494timoninmaxim merged 38 commits intoapache:masterfrom
Conversation
29b0bf5 to
322ed7c
Compare
322ed7c to
780bfe8
Compare
| } | ||
|
|
||
| /** Base rolling upgrade command argument. */ | ||
| public static class RollingUpgradeCommandArg extends IgniteDataTransferObject { |
There was a problem hiding this comment.
Let's move all nested classes to separate files
| } | ||
|
|
||
| /** Base rolling upgrade command argument. */ | ||
| public static class RollingUpgradeCommandArg extends IgniteDataTransferObject { |
|
|
||
| /** {@inheritDoc} */ | ||
| @Override public Collection<ClusterNode> nodes(Collection<ClusterNode> nodes, RollingUpgradeCommandArg arg) { | ||
| return coordinatorOrNull(nodes); |
There was a problem hiding this comment.
We must send message only on coordinator. In case of null default node is chosen.
|
|
||
| /** Task to manage rolling upgrade. */ | ||
| @GridInternal | ||
| public class RollingUpgradeTask extends VisorOneNodeTask<RollingUpgradeCommandArg, String> { |
There was a problem hiding this comment.
String looks wrong, task should return result - boolean/Throwable/versions, and caller should handle task result - build a message to user, store state, etc
| control.(sh|bat) --rolling-upgrade enable 2.18.0 | ||
|
|
||
| Parameters: | ||
| 2.18.0 - Target Ignite version. |
| public class RollingUpgradeDisableCommand implements ComputeCommand<NoArg, RollingUpgradeTaskResult> { | ||
| /** {@inheritDoc} */ | ||
| @Override public String description() { | ||
| return "Disable rolling upgrade"; |
There was a problem hiding this comment.
Let's mention that all nodes in cluster must be the same version.
| private boolean enabled; | ||
|
|
||
| /** */ | ||
| private IgnitePair<IgniteProductVersion> rollUpVers; |
There was a problem hiding this comment.
IgnitePair is an internal class. Should not escaped to control.sh.
|
|
||
| /** Command to enable rolling upgrade. */ | ||
| @IgniteExperimental | ||
| public class RollingUpgradeEnableCommand implements ComputeCommand<RollingUpgradeEnableCommandArg, RollingUpgradeTaskResult> { |
There was a problem hiding this comment.
Let's also add a confirmation prompt, also let's write it in description and javadocs.
"This command enables rolling upgrade mode. It allows cluster with mixed-version nodes. You are responsible for upgrading nodes manually. This mode can be disabled only when all nodes (including client nodes) run the same version."
| private static final long serialVersionUID = 0; | ||
|
|
||
| /** Target version. */ | ||
| @Argument(description = "Target Ignite version", example = "2.18.0") |
| private IgnitePair<IgniteProductVersion> rollUpVers; | ||
|
|
||
| /** */ | ||
| private Throwable exception; |
There was a problem hiding this comment.
User should not receive full exception with internal ignite stacktrace. Let's send only exception message instead.
| } | ||
|
|
||
| /** */ | ||
| public boolean enabled() { |
This reverts commit 94a396f
|



Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.