ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1758
Date Thu, 29 Oct 2015 09:52:00 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1758 fc8c6834b -> f302a73fc


ignite-1758


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

Branch: refs/heads/ignite-1758
Commit: f302a73fc0c6ca75bff4a476ca1e8bac34b58a9f
Parents: fc8c683
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Oct 29 10:19:51 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Oct 29 12:51:52 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 14 ++++-
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  2 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 66 +++++++++-----------
 .../messages/TcpDiscoveryNodeAddedMessage.java  |  4 +-
 .../tcp/TcpDiscoveryMultiThreadedTest.java      |  6 +-
 5 files changed, 48 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f302a73f/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 4820a93..5a0fe16 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -165,6 +165,7 @@ import org.apache.ignite.plugin.PluginNotFoundException;
 import org.apache.ignite.plugin.PluginProvider;
 import org.apache.ignite.spi.IgniteSpi;
 import org.apache.ignite.spi.IgniteSpiVersionCheckException;
+import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
 import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_CONFIG_URL;
@@ -3158,10 +3159,17 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
     /** {@inheritDoc} */
     public void dumpDebugInfo() {
-        U.warn(log, "Dumping debug info for node [id=" + ctx.localNodeId() +
+        boolean client = ctx.clientNode();
+
+        ClusterNode locNode = ctx.discovery().localNode();
+
+        UUID routerId = locNode instanceof TcpDiscoveryNode ? ((TcpDiscoveryNode)locNode).clientRouterNodeId()
: null;
+
+        U.warn(log, "Dumping debug info for node [id=" + locNode.id() +
             ", name=" + ctx.gridName() +
-            ", order=" + ctx.discovery().localNode().order() +
-            ", client=" + ctx.clientNode() + ']');
+            ", order=" + locNode.order() +
+            ", client=" + client +
+            (client && routerId != null ? ", routerId=" + routerId : "") + ']');
 
         ctx.cache().context().exchange().dumpDebugInfo();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f302a73f/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 1cc93aa..a4619c6 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -710,7 +710,7 @@ class ClientImpl extends TcpDiscoveryImpl {
 
             Collection<ClusterNode> top = topHist.get(topVer);
 
-            assert top != null : msg;
+            assert top != null : "Failed to find topology history [msg=" + msg + ", hist="
+ topHist + ']';
 
             return top;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f302a73f/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 5f88bf8..a4fb6fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -1396,25 +1396,6 @@ class ServerImpl extends TcpDiscoveryImpl {
             TcpDiscoveryNode node = nodeAddedMsg.node();
 
             if (node.id().equals(destNodeId)) {
-                Collection<TcpDiscoveryNode> allNodes = ring.allNodes();
-
-                Collection<TcpDiscoveryNode> topToSnd = nodeAddedMsg.topology();
-
-                if (topToSnd == null)
-                    topToSnd = new ArrayList<>(allNodes.size());
-
-                for (TcpDiscoveryNode n0 : allNodes) {
-                    assert n0.internalOrder() != 0 : n0;
-
-                    // Skip next node and nodes added after next
-                    // in case this message is resent due to failures/leaves.
-                    // There will be separate messages for nodes with greater
-                    // internal order.
-                    if (n0.internalOrder() < nodeAddedMsg.node().internalOrder())
-                        topToSnd.add(n0);
-                }
-
-                nodeAddedMsg.topology(topToSnd);
                 nodeAddedMsg.messages(msgs, discardMsgId, discardCustomMsgId);
 
                 Map<Long, Collection<ClusterNode>> hist;
@@ -1436,7 +1417,6 @@ class ServerImpl extends TcpDiscoveryImpl {
             // Nullify topology before registration.
             TcpDiscoveryNodeAddedMessage nodeAddedMsg = (TcpDiscoveryNodeAddedMessage)msg;
 
-            nodeAddedMsg.topology(null);
             nodeAddedMsg.topologyHistory(null);
             nodeAddedMsg.messages(null, null, null);
         }
@@ -3177,8 +3157,13 @@ class ServerImpl extends TcpDiscoveryImpl {
                                 log.debug("Failing reconnecting client node because failed
to restore pending " +
                                     "messages [locNodeId=" + locNodeId + ", clientNodeId="
+ nodeId + ']');
 
-                            processNodeFailedMessage(new TcpDiscoveryNodeFailedMessage(locNodeId,
-                                node.id(), node.internalOrder()));
+                            TcpDiscoveryNodeFailedMessage nodeFailedMsg = new TcpDiscoveryNodeFailedMessage(locNodeId,
+                                node.id(), node.internalOrder());
+
+                            processNodeFailedMessage(nodeFailedMsg);
+
+                            if (nodeFailedMsg.verified())
+                                msgHist.add(nodeFailedMsg);
                         }
                     }
                     else if (log.isDebugEnabled())
@@ -3271,20 +3256,18 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                 msg.verify(locNodeId);
 
-                if (node.isClient()) {
-                    Collection<TcpDiscoveryNode> allNodes = ring.allNodes();
-
-                    Collection<TcpDiscoveryNode> top = new ArrayList<>(allNodes.size());
+                Collection<TcpDiscoveryNode> allNodes = ring.allNodes();
 
-                    for (TcpDiscoveryNode n0 : allNodes) {
-                        assert n0.internalOrder() > 0 : n0;
+                Collection<TcpDiscoveryNode> top = new ArrayList<>(allNodes.size());
 
-                        if (n0.internalOrder() < node.internalOrder())
-                            top.add(n0);
-                    }
+                for (TcpDiscoveryNode n0 : allNodes) {
+                    assert n0.internalOrder() > 0 : n0;
 
-                    msg.topology(top);
+                    if (n0.internalOrder() < node.internalOrder())
+                        top.add(n0);
                 }
+
+                msg.topology(top);
             }
             else if (!locNodeId.equals(node.id()) && ring.node(node.id()) != null)
{
                 // Local node already has node from message in local topology.
@@ -3448,7 +3431,6 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                             // Clear data to minimize message size.
                             msg.messages(null, null, null);
-                            msg.topology(null);
                             msg.topologyHistory(null);
                             msg.clearDiscoveryData();
                         }
@@ -4188,9 +4170,15 @@ class ServerImpl extends TcpDiscoveryImpl {
                                         failedNode = failedNodes.contains(clientNode);
                                     }
 
-                                    if (!failedNode)
-                                        processNodeFailedMessage(new TcpDiscoveryNodeFailedMessage(locNodeId,
-                                            clientNode.id(), clientNode.internalOrder()));
+                                    if (!failedNode) {
+                                        TcpDiscoveryNodeFailedMessage nodeFailedMsg = new
TcpDiscoveryNodeFailedMessage(
+                                            locNodeId, clientNode.id(), clientNode.internalOrder());
+
+                                        processNodeFailedMessage(nodeFailedMsg);
+
+                                        if (nodeFailedMsg.verified())
+                                            msgHist.add(nodeFailedMsg);
+                                    }
                                 }
                             }
                         }
@@ -4416,8 +4404,12 @@ class ServerImpl extends TcpDiscoveryImpl {
             if (joiningNodes.isEmpty() && isLocalNodeCoordinator()) {
                 TcpDiscoveryCustomEventMessage msg;
 
-                while ((msg = pendingCustomMsgs.poll()) != null)
+                while ((msg = pendingCustomMsgs.poll()) != null) {
                     processCustomMessage(msg);
+
+                    if (msg.verified())
+                        msgHist.add(msg);
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f302a73f/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
index 5a7146d..6ce362c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java
@@ -158,7 +158,9 @@ public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractMessage
{
      *
      * @param top Current topology.
      */
-    public void topology(@Nullable Collection<TcpDiscoveryNode> top) {
+    public void topology(Collection<TcpDiscoveryNode> top) {
+        assert top != null;
+
         this.top = top;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f302a73f/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
index 0c38ee3..8ad5d33 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
@@ -113,7 +113,7 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
         cfg.setDiscoverySpi(new TcpDiscoverySpi().
             setIpFinder(ipFinder).
             setJoinTimeout(60_000).
-            setNetworkTimeout(60_000));
+            setNetworkTimeout(10_000));
 
         int[] evts = {EVT_NODE_FAILED, EVT_NODE_LEFT};
 
@@ -334,7 +334,7 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
                 GRID_CNT - 1,
                 "server-restart");
 
-            final long timeToExec = 2 * 60 * 1000;
+            final long timeToExec = getTestTimeout() - 60_000;
 
             final long endTime = System.currentTimeMillis() + timeToExec;
 
@@ -355,6 +355,8 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
                 }
             }
 
+            log.info("Stop test.");
+
             done.set(true);
 
             fut1.get();


Mime
View raw message