ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [20/22] ignite git commit: IGNITE-10523 Ignite Compatibility: add check that started node is of expected version. - Fixes #5570.
Date Wed, 05 Dec 2018 07:31:28 GMT
IGNITE-10523 Ignite Compatibility: add check that started node is of expected version. - Fixes
#5570.

Signed-off-by: Dmitriy Pavlov <dpavlov@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bb56dc6d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bb56dc6d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bb56dc6d

Branch: refs/heads/ignite-10189
Commit: bb56dc6d4843c426b0d5f0015abe8dc3af794276
Parents: 7f758bf
Author: Vyacheslav Daradur <daradurvs@gmail.com>
Authored: Tue Dec 4 20:13:31 2018 +0300
Committer: Dmitriy Pavlov <dpavlov@apache.org>
Committed: Tue Dec 4 20:13:31 2018 +0300

----------------------------------------------------------------------
 .../junits/IgniteCompatibilityAbstractTest.java       |  3 ++-
 .../junits/IgniteCompatibilityNodeRunner.java         | 14 ++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bb56dc6d/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java
index b0e4001..826edba 100644
--- a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java
+++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java
@@ -153,7 +153,8 @@ public abstract class IgniteCompatibilityAbstractTest extends GridCommonAbstract
             @Override protected String params(IgniteConfiguration cfg, boolean resetDiscovery)
throws Exception {
                 return cfgCloPath + " " + igniteInstanceName + " "
                     + getId() + " "
-                    + (rmJvmInstance == null ? getId() : ((IgniteProcessProxy)rmJvmInstance).getId())
+                    + (rmJvmInstance == null ? getId() : ((IgniteProcessProxy)rmJvmInstance).getId())
+ " "
+                    + ver
                     + (cloPath == null ? "" : " " + cloPath);
             }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/bb56dc6d/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java
----------------------------------------------------------------------
diff --git a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java
index 165cb4c..5421850 100644
--- a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java
+++ b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityNodeRunner.java
@@ -36,6 +36,7 @@ import org.apache.ignite.internal.util.GridJavaProcess;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.lang.IgniteProductVersion;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.multijvm.IgniteNodeRunner;
 import org.jetbrains.annotations.NotNull;
@@ -59,7 +60,8 @@ public class IgniteCompatibilityNodeRunner extends IgniteNodeRunner {
      * args[2] - required - id of the starting node;
      * args[3] - required - sync-id of a node for synchronization of startup. Must be equals
      * to arg[2] in case of starting the first node in the Ignite cluster;
-     * args[4] - optional - path to closure for actions after node startup.
+     * args[4] - required - expected Ignite's version to check at startup;
+     * args[5] - optional - path to closure for actions after node startup.
      * </pre>
      *
      * @param args Command-line arguments.
@@ -73,7 +75,7 @@ public class IgniteCompatibilityNodeRunner extends IgniteNodeRunner {
 
             if (args.length < 3) {
                 throw new IllegalArgumentException("At least four arguments expected:" +
-                    " [path/to/closure/file] [ignite-instance-name] [node-id] [sync-node-id]
[optional/path/to/closure/file]");
+                    " [path/to/closure/file] [ignite-instance-name] [node-id] [sync-node-id]
[node-ver] [optional/path/to/closure/file]");
             }
 
             final Thread watchdog = delayedDumpClasspath();
@@ -86,6 +88,7 @@ public class IgniteCompatibilityNodeRunner extends IgniteNodeRunner {
 
             final UUID nodeId = UUID.fromString(args[2]);
             final UUID syncNodeId = UUID.fromString(args[3]);
+            final IgniteProductVersion expNodeVer = IgniteProductVersion.fromString(args[4]);
 
             // Ignite instance name and id must be set according to arguments
             // it's used for nodes managing: start, stop etc.
@@ -96,11 +99,14 @@ public class IgniteCompatibilityNodeRunner extends IgniteNodeRunner {
 
             assert ignite.cluster().node(syncNodeId) != null : "Node has not joined [id="
+ nodeId + "]";
 
+            assert ignite.cluster().localNode().version().compareToIgnoreTimestamp(expNodeVer)
== 0 : "Node is of unexpected " +
+                "version: [act=" + ignite.cluster().localNode().version() + ", exp=" + expNodeVer
+ ']';
+
             // It needs to set private static field 'ignite' of the IgniteNodeRunner class
via reflection
             GridTestUtils.setFieldValue(new IgniteNodeRunner(), "ignite", ignite);
 
-            if (args.length == 5) {
-                IgniteInClosure<Ignite> clo = readClosureFromFileAndDelete(args[4]);
+            if (args.length == 6) {
+                IgniteInClosure<Ignite> clo = readClosureFromFileAndDelete(args[5]);
 
                 clo.apply(ignite);
             }


Mime
View raw message