timoninmaxim commented on code in PR #12513:
URL: https://github.com/apache/ignite/pull/12513#discussion_r2518360944


##########
modules/control-utility/src/test/java/org/apache/ignite/util/RollingUpgradeCommandTest.java:
##########
@@ -127,4 +138,30 @@ public void testEnableWithDifferentTargetVersions() {
 
         assertTrue(crd.context().rollingUpgrade().enabled());
     }
+
+    /** */
+    @Test
+    public void testForceEnable() {
+        IgniteProductVersion curVer = 
IgniteProductVersion.fromString(crd.localNode().attribute(ATTR_BUILD_VER));
+
+        String targetVerStr = curVer.major() + "." + (curVer.minor() + 1) + 
"." + (curVer.maintenance() + 1);
+        IgniteProductVersion targetVer = 
IgniteProductVersion.fromString(targetVerStr);
+
+        execute(ROLLING_UPGRADE, ENABLE, targetVerStr, FORCE);

Review Comment:
   Let's check it failed without this flag



##########
modules/core/src/test/resources/org.apache.ignite.util/GridCommandHandlerClusterByClassWithSSLTest_help.output:
##########
@@ -373,10 +373,11 @@ If the file name isn't specified the output file name is: 
'<typeId>.bin':
 
   [EXPERIMENTAL]
   Enable rolling upgrade mode. It allows cluster with mixed-version nodes:
-      control.(sh|bat) --rolling-upgrade enable target_version
+      control.(sh|bat) --rolling-upgrade enable target_version --force
 
       Parameters:
         target_version  - Target Ignite version. The target version can be one 
minor higher if its maintenance version is zero, or one maintenance version 
higher (e.g. 2.18.0 -> 2.18.1 or 2.18.1 -> 2.19.0).
+        --force         - Enable rolling upgrade without target version checks.

Review Comment:
   Add a warning, like "do not use without good reason" or smth



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/RollingUpgradeProcessor.java:
##########
@@ -150,11 +150,23 @@ public RollingUpgradeProcessor(GridKernalContext ctx) {
         return new IgniteNodeValidationResult(node.id(), errMsg);
     }
 
+    /**
+     * Enables rolling upgrade with specified target version.
+     *
+     * @param target Target version.
+     * @see #enable(IgniteProductVersion, boolean)
+     */
+    public void enable(IgniteProductVersion target) throws 
IgniteCheckedException {

Review Comment:
   No need in this method



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/RollingUpgradeProcessor.java:
##########
@@ -278,32 +299,20 @@ public boolean enabled() {
      *
      * @param cur Current cluster version.
      * @param target Target cluster version.
-     * @return {@code false} if there is no need to update versions {@code 
true} otherwise.
      * @throws IgniteCheckedException If versions are incorrect.
      */
-    private boolean checkVersionsForEnabling(IgniteProductVersion cur, 
IgniteProductVersion target) throws IgniteCheckedException {
-        IgnitePair<IgniteProductVersion> oldVerPair = rollUpVers;
-        if (oldVerPair != null) {
-            if (oldVerPair.get1().equals(cur) && 
oldVerPair.get2().equals(target))
-                return false;
-
-            throw new IgniteCheckedException("Rolling upgrade is already 
enabled with a different current and target version: " +
-                oldVerPair.get1() + " , " + oldVerPair.get2());
-        }
-

Review Comment:
   for which reason?



-- 
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]

Reply via email to