Skip to content

IGNITE-26748 Add rolling upgrade commands for control.sh#12494

Merged
timoninmaxim merged 38 commits intoapache:masterfrom
chesnokoff:IGNITE-26748
Nov 7, 2025
Merged

IGNITE-26748 Add rolling upgrade commands for control.sh#12494
timoninmaxim merged 38 commits intoapache:masterfrom
chesnokoff:IGNITE-26748

Conversation

@chesnokoff
Copy link
Copy Markdown
Contributor

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

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached 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.

@chesnokoff chesnokoff force-pushed the IGNITE-26748 branch 3 times, most recently from 29b0bf5 to 322ed7c Compare November 5, 2025 07:29
}

/** Base rolling upgrade command argument. */
public static class RollingUpgradeCommandArg extends IgniteDataTransferObject {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's move all nested classes to separate files

}

/** Base rolling upgrade command argument. */
public static class RollingUpgradeCommandArg extends IgniteDataTransferObject {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cas use NoArg instead?


/** {@inheritDoc} */
@Override public Collection<ClusterNode> nodes(Collection<ClusterNode> nodes, RollingUpgradeCommandArg arg) {
return coordinatorOrNull(nodes);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

2.18.0 --> target_version?

public class RollingUpgradeDisableCommand implements ComputeCommand<NoArg, RollingUpgradeTaskResult> {
/** {@inheritDoc} */
@Override public String description() {
return "Disable rolling upgrade";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's mention that all nodes in cluster must be the same version.

private boolean enabled;

/** */
private IgnitePair<IgniteProductVersion> rollUpVers;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IgnitePair is an internal class. Should not escaped to control.sh.


/** Command to enable rolling upgrade. */
@IgniteExperimental
public class RollingUpgradeEnableCommand implements ComputeCommand<RollingUpgradeEnableCommandArg, RollingUpgradeTaskResult> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be positional.

private IgnitePair<IgniteProductVersion> rollUpVers;

/** */
private Throwable exception;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

User should not receive full exception with internal ignite stacktrace. Let's send only exception message instead.

}

/** */
public boolean enabled() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Used in tests only.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Nov 7, 2025

@timoninmaxim timoninmaxim merged commit b090ee5 into apache:master Nov 7, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants