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 Discovery fixes.
Date Thu, 12 Nov 2015 14:13:12 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1758-debug 7819ae01e -> 9b7717c9f


ignite-1758 Discovery fixes.


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

Branch: refs/heads/ignite-1758-debug
Commit: 9b7717c9f929c7643abee811646b06d6933f9ebf
Parents: 7819ae0
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Nov 12 17:13:01 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Nov 12 17:13:01 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 62 +++++++++++---------
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |  4 +-
 .../tcp/TcpDiscoveryMultiThreadedTest.java      |  4 +-
 .../IgniteSpiDiscoverySelfTestSuite.java        | 29 ++++++++-
 4 files changed, 68 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9b7717c9/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 7affb6c..c672bd0 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
@@ -1125,7 +1125,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                 spi.stats.onMessageSent(msg, U.currentTimeMillis() - tstamp);
 
                 if (debugMode)
-                    debugLog("Message has been sent directly to address [msg=" + msg + ",
addr=" + addr +
+                    debugLog(msg, "Message has been sent directly to address [msg=" + msg
+ ", addr=" + addr +
                         ", rmtNodeId=" + res.creatorNodeId() + ']');
 
                 if (log.isDebugEnabled())
@@ -2173,7 +2173,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                 log.debug("Processing message [cls=" + msg.getClass().getSimpleName() + ",
id=" + msg.id() + ']');
 
             if (debugMode)
-                debugLog("Processing message [cls=" + msg.getClass().getSimpleName() + ",
id=" + msg.id() + ']');
+                debugLog(msg, "Processing message [cls=" + msg.getClass().getSimpleName()
+ ", id=" + msg.id() + ']');
 
             if (locNode.internalOrder() == 0) {
                 boolean process = false;
@@ -2336,7 +2336,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                         log.debug("No next node in topology.");
 
                     if (debugMode)
-                        debugLog("No next node in topology.");
+                        debugLog(msg, "No next node in topology.");
 
                     if (ring.hasRemoteNodes() && !(msg instanceof TcpDiscoveryConnectionCheckMessage)
&&
                         !(msg instanceof TcpDiscoveryStatusCheckMessage && msg.creatorNodeId().equals(locNodeId)))
{
@@ -2354,7 +2354,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                             ", ring=" + ring + ", failedNodes=" + failedNodes + ']');
 
                     if (debugMode)
-                        debugLog("New next node [newNext=" + newNext + ", formerNext=" +
next +
+                        debugLog(msg, "New next node [newNext=" + newNext + ", formerNext="
+ next +
                             ", ring=" + ring + ", failedNodes=" + failedNodes + ']');
 
                     U.closeQuiet(sock);
@@ -2441,8 +2441,8 @@ class ServerImpl extends TcpDiscoveryImpl {
                                             "expected [expectedId=" + next.id() + ", rcvdId="
+ nextId + ']');
 
                                     if (debugMode)
-                                        debugLog("Failed to restore ring because next node
ID received is not as " +
-                                            "expected [expectedId=" + next.id() + ", rcvdId="
+ nextId + ']');
+                                        debugLog(msg, "Failed to restore ring because next
node ID received is not " +
+                                            "as expected [expectedId=" + next.id() + ", rcvdId="
+ nextId + ']');
 
                                     break;
                                 }
@@ -2463,8 +2463,8 @@ class ServerImpl extends TcpDiscoveryImpl {
                                                     ", rcvd=" + nextOrder + ", id=" + next.id()
+ ']');
 
                                             if (debugMode)
-                                                debugLog("Failed to restore ring because
next node order received " +
-                                                    "is not as expected [expected=" + next.internalOrder()
+
+                                                debugLog(msg, "Failed to restore ring because
next node order " +
+                                                    "received is not as expected [expected="
+ next.internalOrder() +
                                                     ", rcvd=" + nextOrder + ", id=" + next.id()
+ ']');
 
                                             break;
@@ -2475,7 +2475,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                                         log.debug("Initialized connection with next node:
" + next.id());
 
                                     if (debugMode)
-                                        debugLog("Initialized connection with next node:
" + next.id());
+                                        debugLog(msg, "Initialized connection with next node:
" + next.id());
 
                                     errs = null;
 
@@ -2546,7 +2546,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                                         ", forceSndPending=" + forceSndPending + ']');
 
                                 if (debugMode)
-                                    debugLog("Pending messages will be sent [failure=" +
failure +
+                                    debugLog(msg, "Pending messages will be sent [failure="
+ failure +
                                         ", newNextNode=" + newNextNode +
                                         ", forceSndPending=" + forceSndPending + ']');
 
@@ -2577,7 +2577,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                                             ", res=" + res + ']');
 
                                     if (debugMode)
-                                        debugLog("Pending message has been sent to next node
[msgId=" + msg.id() +
+                                        debugLog(msg, "Pending message has been sent to next
node [msgId=" + msg.id() +
                                             ", pendingMsgId=" + pendingMsg.id() + ", next="
+ next.id() +
                                             ", res=" + res + ']');
 
@@ -2620,15 +2620,17 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                                 onMessageExchanged();
 
-                                if (log.isDebugEnabled())
+                                if (log.isDebugEnabled()) {
                                     log.debug("Message has been sent to next node [msg="
+ msg +
                                         ", next=" + next.id() +
                                         ", res=" + res + ']');
+                                }
 
-                                if (debugMode)
-                                    debugLog("Message has been sent to next node [msg=" +
msg +
+                                if (debugMode) {
+                                    debugLog(msg, "Message has been sent to next node [msg="
+ msg +
                                         ", next=" + next.id() +
                                         ", res=" + res + ']');
+                                }
                             }
                             finally {
                                 clearNodeAddedMessage(msg);
@@ -2741,7 +2743,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                         log.debug("Pending messages will be resent to local node");
 
                     if (debugMode)
-                        debugLog("Pending messages will be resent to local node");
+                        debugLog(msg, "Pending messages will be resent to local node");
 
                     for (TcpDiscoveryAbstractMessage pendingMsg : pendingMsgs) {
                         prepareNodeAddedMessage(pendingMsg, locNodeId, pendingMsgs.msgs,
pendingMsgs.discardId,
@@ -2755,9 +2757,10 @@ class ServerImpl extends TcpDiscoveryImpl {
                             log.debug("Pending message has been sent to local node [msg="
+ msg.id() +
                                 ", pendingMsgId=" + pendingMsg + ']');
 
-                        if (debugMode)
-                            debugLog("Pending message has been sent to local node [msg="
+ msg.id() +
+                        if (debugMode) {
+                            debugLog(msg, "Pending message has been sent to local node [msg="
+ msg.id() +
                                 ", pendingMsgId=" + pendingMsg + ']');
+                        }
                     }
                 }
 
@@ -3391,15 +3394,17 @@ class ServerImpl extends TcpDiscoveryImpl {
                 if (sendMessageToRemotes(msg))
                     sendMessageAcrossRing(msg);
 
-                if (log.isDebugEnabled())
+                if (log.isDebugEnabled()) {
                     log.debug("Local node already has node being added. Passing TcpDiscoveryNodeAddedMessage
to " +
-                                  "coordinator for final processing [ring=" + ring + ", node="
+ node + ", locNode="
-                                  + locNode + ", msg=" + msg + ']');
+                        "coordinator for final processing [ring=" + ring + ", node=" + node
+ ", locNode="
+                        + locNode + ", msg=" + msg + ']');
+                }
 
-                if (debugMode)
-                    debugLog("Local node already has node being added. Passing TcpDiscoveryNodeAddedMessage
to " +
-                                 "coordinator for final processing [ring=" + ring + ", node="
+ node + ", locNode="
-                                 + locNode + ", msg=" + msg + ']');
+                if (debugMode) {
+                    debugLog(msg, "Local node already has node being added. Passing TcpDiscoveryNodeAddedMessage
to " +
+                        "coordinator for final processing [ring=" + ring + ", node=" + node
+ ", locNode="
+                        + locNode + ", msg=" + msg + ']');
+                }
 
                 return;
             }
@@ -3412,7 +3417,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                             ", msg=" + msg + ']');
 
                     if (debugMode)
-                        debugLog("Discarding node added message since new node's order is
less than " +
+                        debugLog(msg, "Discarding node added message since new node's order
is less than " +
                             "max order in ring [ring=" + ring + ", node=" + node + ", locNode="
+ locNode +
                             ", msg=" + msg + ']');
 
@@ -4996,9 +5001,10 @@ class ServerImpl extends TcpDiscoveryImpl {
                         log.debug("Initialized connection with remote node [nodeId=" + nodeId
+
                             ", client=" + req.client() + ']');
 
-                    if (debugMode)
-                        debugLog("Initialized connection with remote node [nodeId=" + nodeId
+
+                    if (debugMode) {
+                        debugLog(msg, "Initialized connection with remote node [nodeId="
+ nodeId +
                             ", client=" + req.client() + ']');
+                    }
                 }
                 catch (IOException e) {
                     if (log.isDebugEnabled())
@@ -5067,7 +5073,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                         spi.stats.onMessageReceived(msg);
 
                         if (debugMode && recordable(msg))
-                            debugLog("Message has been received: " + msg);
+                            debugLog(msg, "Message has been received: " + msg);
 
                         if (msg instanceof TcpDiscoveryConnectionCheckMessage) {
                             spi.writeToSocket(msg, sock, RES_OK, socketTimeout);

http://git-wip-us.apache.org/repos/asf/ignite/blob/9b7717c9/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
index 2786d0b..1aef728 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
@@ -37,6 +37,7 @@ import org.apache.ignite.spi.IgniteSpiException;
 import org.apache.ignite.spi.IgniteSpiThread;
 import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage;
 import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
+import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -99,9 +100,10 @@ abstract class TcpDiscoveryImpl {
     }
 
     /**
+     * @param discoMsg Discovery message.
      * @param msg Message.
      */
-    protected void debugLog(String msg) {
+    protected void debugLog(@Nullable TcpDiscoveryAbstractMessage discoMsg, String msg) {
         assert debugMode;
 
         String msg0 = new SimpleDateFormat("[HH:mm:ss,SSS]").format(new Date(System.currentTimeMillis()))
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/9b7717c9/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 31b48a3..5053c2d 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
@@ -211,13 +211,15 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
      * @throws Exception If any error occurs.
      */
     public void testMultiThreadedClientsServersRestart() throws Throwable {
+        fail("https://issues.apache.org/jira/browse/IGNITE-1123");
+
         multiThreadedClientsServersRestart(GRID_CNT, CLIENT_GRID_CNT);
     }
 
     /**
      * @throws Exception If any error occurs.
      */
-    public void testMultiThreadedServersRestart() throws Throwable {
+    public void _testMultiThreadedServersRestart() throws Throwable {
         multiThreadedClientsServersRestart(GRID_CNT * 2, 0);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9b7717c9/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
index 004527c..af86fbb 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
@@ -51,8 +51,35 @@ public class IgniteSpiDiscoverySelfTestSuite extends TestSuite {
     public static TestSuite suite() throws Exception {
         TestSuite suite = new TestSuite("Ignite Discovery SPI Test Suite");
 
+        // Tcp.
+        suite.addTest(new TestSuite(TcpDiscoveryVmIpFinderSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoverySharedFsIpFinderSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoveryJdbcIpFinderSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoveryMulticastIpFinderSelfTest.class));
+
+        suite.addTest(new TestSuite(TcpDiscoverySelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoverySpiSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoverySpiFailureTimeoutSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoverySpiStartStopSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoverySpiConfigSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoveryMarshallerCheckSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoverySnapshotHistoryTest.class));
+
+        suite.addTest(new TestSuite(GridTcpSpiForwardingSelfTest.class));
+
+        suite.addTest(new TestSuite(TcpClientDiscoverySpiSelfTest.class));
+        suite.addTest(new TestSuite(TcpClientDiscoveryMarshallerCheckSelfTest.class));
+        suite.addTest(new TestSuite(TcpClientDiscoverySpiMulticastTest.class));
+        suite.addTest(new TestSuite(TcpClientDiscoverySpiFailureTimeoutSelfTest.class));
+
+        suite.addTest(new TestSuite(TcpDiscoveryNodeConsistentIdSelfTest.class));
+        suite.addTest(new TestSuite(TcpDiscoveryNodeConfigConsistentIdSelfTest.class));
+
+        suite.addTest(new TestSuite(TcpDiscoveryRestartTest.class));
         suite.addTest(new TestSuite(TcpDiscoveryMultiThreadedTest.class));
-        suite.addTest(new TestSuite(TcpDiscoveryMultiThreadedTest.class));
+
+        // SSL.
+        suite.addTest(new TestSuite(TcpDiscoverySslSelfTest.class));
 
         return suite;
     }


Mime
View raw message