ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [19/50] [abbrv] incubator-ignite git commit: #IGNITE-250 Fixed tests.
Date Sat, 14 Feb 2015 22:15:01 GMT
#IGNITE-250 Fixed tests.


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

Branch: refs/heads/ignite-9655-merge
Commit: 9ae0eb892fa7dac07655b097826e9def4380801e
Parents: 2950a16
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Sat Feb 14 14:34:43 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Sat Feb 14 14:34:43 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 38 ++++++++++++++++++++
 .../internal/GridReleaseTypeSelfTest.java       | 35 ++----------------
 2 files changed, 40 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ae0eb89/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index cb1f1d1..0df53f9 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -3182,6 +3182,44 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
                 String rmtBuildVer = node.attribute(ATTR_BUILD_VER);
 
                 if (!F.eq(rmtBuildVer, locBuildVer)) {
+                    // OS nodes don't support rolling updates.
+                    if (!locBuildVer.equals(rmtBuildVer)) {
+                        String errMsg = "Local node and remote node have different version
numbers " +
+                            "(node will not join, Ignite does not support rolling updates,
" +
+                            "so versions must be exactly the same) " +
+                            "[locBuildVer=" + locBuildVer + ", rmtBuildVer=" + rmtBuildVer
+
+                            ", locNodeAddrs=" + U.addressesAsString(locNode) +
+                            ", rmtNodeAddrs=" + U.addressesAsString(node) +
+                            ", locNodeId=" + locNode.id() + ", rmtNodeId=" + msg.creatorNodeId()
+ ']';
+
+                        LT.warn(log, null, errMsg);
+
+                        // Always output in debug.
+                        if (log.isDebugEnabled())
+                            log.debug(errMsg);
+
+                        try {
+                            String sndMsg = "Local node and remote node have different version
numbers " +
+                                "(node will not join, Ignite does not support rolling updates,
" +
+                                "so versions must be exactly the same) " +
+                                "[locBuildVer=" + rmtBuildVer + ", rmtBuildVer=" + locBuildVer
+
+                                ", locNodeAddrs=" + U.addressesAsString(node) + ", locPort="
+ node.discoveryPort() +
+                                ", rmtNodeAddr=" + U.addressesAsString(locNode) + ", locNodeId="
+ node.id() +
+                                ", rmtNodeId=" + locNode.id() + ']';
+
+                            trySendMessageDirectly(node,
+                                    new TcpDiscoveryCheckFailedMessage(locNodeId, sndMsg));
+                        }
+                        catch (IgniteSpiException e) {
+                            if (log.isDebugEnabled())
+                                log.debug("Failed to send version check failed message to
node " +
+                                    "[node=" + node + ", err=" + e.getMessage() + ']');
+                        }
+
+                        // Ignore join request.
+                        return;
+                    }
+
                     Collection<String> locCompatibleVers = locNode.attribute(ATTR_COMPATIBLE_VERS);
                     Collection<String> rmtCompatibleVers = node.attribute(ATTR_COMPATIBLE_VERS);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ae0eb89/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
index a2bb7f0..284aa0c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java
@@ -73,40 +73,9 @@ public class GridReleaseTypeSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testNodeJoinTopologyWithDifferentReleaseType() throws Exception {
-        firstNodeVer = "1.0.0-ent";
-        secondNodeVer = "1.0.0-os";
-
-        try {
-            startGrids(2);
-        }
-        catch (IgniteCheckedException e) {
-            StringWriter errors = new StringWriter();
-
-            e.printStackTrace(new PrintWriter(errors));
-
-            String stackTrace = errors.toString();
-
-            assertTrue(
-                "Caught exception does not contain specified string.",
-                stackTrace.contains("Topology cannot contain nodes of both enterprise and
open source")
-            );
-
-            return;
-        }
-        finally {
-            stopAllGrids();
-        }
-
-        fail("Exception has not been thrown.");
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testOsEditionDoesNotSupportRollingUpdates() throws Exception {
-        firstNodeVer = "1.0.0-os";
-        secondNodeVer = "1.0.1-os";
+        firstNodeVer = "1.0.0";
+        secondNodeVer = "1.0.1";
 
         try {
             startGrids(2);


Mime
View raw message