You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2016/12/05 14:41:37 UTC

[15/50] [abbrv] ignite git commit: added debug for hanging exchange - 10.11.2016

added debug for hanging exchange - 10.11.2016


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

Branch: refs/heads/ignite-comm-balance-master
Commit: cee9cc66f3260b43bbaac20f587d29b30025bd48
Parents: bc5dc6b
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Thu Nov 10 19:10:43 2016 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu Nov 10 19:10:43 2016 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  3 ++
 .../GridCachePartitionExchangeManager.java      |  2 ++
 .../GridDhtPartitionsExchangeFuture.java        |  8 +++++
 .../ignite/internal/util/nio/GridNioServer.java | 36 ++++++++++++++++++--
 .../util/tostring/GridToStringBuilder.java      |  2 +-
 .../communication/tcp/TcpCommunicationSpi.java  |  2 +-
 .../ignite/yardstick/IgniteBenchmarkUtils.java  |  6 ++--
 7 files changed, 51 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cee9cc66/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 4fbf4e5..e256df8 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
@@ -1104,6 +1104,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
                                 "    ^-- Outbound messages queue [size=" + m.getOutboundMessagesQueueSize() + "]";
 
                             log.info(msg);
+
+                            // TODO
+                            ctx.io().dumpStats();
                         }
                         catch (IgniteClientDisconnectedException ignore) {
                             // No-op.

http://git-wip-us.apache.org/repos/asf/ignite/blob/cee9cc66/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 8495425..09055ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -1080,6 +1080,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
             }
             else {
                 if (msg.client()) {
+                    U.debug(log, ">>> Received partitions from client [node=" + node + ", msg=" + msg + ']');
+
                     final GridDhtPartitionsExchangeFuture exchFut = exchangeFuture(msg.exchangeId(),
                         null,
                         null,

http://git-wip-us.apache.org/repos/asf/ignite/blob/cee9cc66/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 80b3768..d7a79d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -955,6 +955,9 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
 
         try {
             cctx.io().send(node, m, SYSTEM_POOL);
+
+            U.debug(log, ">>> Sent local partitions [node=" + node + ", clientOnly=" + clientOnlyExchange +
+                ", m=" + m + ']');
         }
         catch (ClusterTopologyCheckedException e) {
             if (log.isDebugEnabled())
@@ -1180,6 +1183,9 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
 
             if (!centralizedAff)
                 sendAllPartitions(node.id(), cctx.gridConfig().getNetworkSendRetryCount());
+
+            if (msg.client())
+                U.debug(log, ">>> Sent all partitions to client [node=" + node + ", msg=" + msg + ']');
         }
         else {
             initFut.listen(new CI1<IgniteInternalFuture<Boolean>>() {
@@ -1344,6 +1350,8 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
 
         final UUID nodeId = node.id();
 
+        U.debug(log, "Received partitions full map [node=" + node + ", msg=" + msg + ']');
+
         if (isDone()) {
             if (log.isDebugEnabled())
                 log.debug("Received message for finished future [msg=" + msg + ", fut=" + this + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/cee9cc66/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index 957f3af..dd0a515 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -1752,6 +1752,8 @@ public class GridNioServer<T> {
 
                                     ses.key(key);
 
+                                    ses.procWrite.set(true);
+
                                     f.onDone(true);
                                 }
                                 else {
@@ -1864,8 +1866,11 @@ public class GridNioServer<T> {
                             while (changeReqs.isEmpty()) {
                                 LockSupport.parkNanos(1_000_000_000);
 
-                                if (Thread.interrupted())
-                                    throw new InterruptedException();
+                                if (Thread.interrupted()) {
+                                    Thread.currentThread().interrupt();
+
+                                    return;
+                                }
                             }
 
                             assert !changeReqs.isEmpty();
@@ -2137,6 +2142,26 @@ public class GridNioServer<T> {
         }
 
         /**
+         * @return Always {@code true} to put it to assert statement.
+         */
+        protected boolean consistent() {
+            int wsCnt = 0;
+
+            for (SelectionKey key : selector.keys()) {
+                boolean opWrite = key.isValid() && (key.interestOps() & SelectionKey.OP_WRITE) != 0;
+
+                if (opWrite)
+                    wsCnt++;
+            }
+
+            assert wsCnt == writeSesCnt : "Worker in illegal state [actualWriteSesCnt=" + wsCnt +
+                ", calculatedWriteSesCnt=" + writeSesCnt +
+                ", worker=" + this + ']';
+
+            return true;
+        }
+
+        /**
          * Checks sessions assigned to a selector for timeouts.
          *
          * @param keys Keys registered to selector.
@@ -2164,7 +2189,9 @@ public class GridNioServer<T> {
 
                     long idleTimeout0 = idleTimeout;
 
-                    if (!opWrite && now - ses.lastReceiveTime() > idleTimeout0 && now - ses.lastSendScheduleTime() > idleTimeout0) {
+                    if (!opWrite &&
+                        now - ses.lastReceiveTime() > idleTimeout0 &&
+                        now - ses.lastSendScheduleTime() > idleTimeout0) {
                         filterChain.onSessionIdleTimeout(ses);
 
                         // Update timestamp to avoid multiple notifications within one timeout interval.
@@ -2176,6 +2203,9 @@ public class GridNioServer<T> {
                     close(ses,  e);
                 }
             }
+
+            // For test purposes only!
+            assert consistent();
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cee9cc66/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java b/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
index b29d7cd..86aa7a1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
@@ -598,4 +598,4 @@ public class GridToStringBuilder {
 
         return cd;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cee9cc66/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 5ec1d1e..dc2e216 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -344,7 +344,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
     private final GridNioServerListener<Message> srvLsnr =
         new GridNioServerListenerAdapter<Message>() {
             @Override public void onSessionWriteTimeout(GridNioSession ses) {
-                LT.warn(log, null, "Communication SPI Session write timed out (consider increasing " +
+                LT.warn(log, null, "Communication SPI session write timed out (consider increasing " +
                     "'socketWriteTimeout' " + "configuration property) [remoteAddr=" + ses.remoteAddress() +
                     ", writeTimeout=" + sockWriteTimeout + ']');
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/cee9cc66/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java
index 54ef00d..07549d5 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java
@@ -30,7 +30,7 @@ import org.apache.ignite.transactions.TransactionConcurrency;
 import org.apache.ignite.transactions.TransactionIsolation;
 import org.apache.ignite.transactions.TransactionOptimisticException;
 import org.apache.ignite.transactions.TransactionRollbackException;
-import org.apache.ignite.yardstick.cache.IgniteSqlQueryBenchmark;
+import org.apache.ignite.yardstick.cache.IgnitePutBenchmark;
 import org.yardstickframework.BenchmarkDriver;
 import org.yardstickframework.BenchmarkDriverStartUp;
 
@@ -89,13 +89,13 @@ public class IgniteBenchmarkUtils {
     public static void main(String[] args) throws Exception {
         final String cfg = "modules/yardstick/config/ignite-localhost-config.xml";
 
-        final Class<? extends BenchmarkDriver> benchmark = IgniteSqlQueryBenchmark.class;
+        final Class<? extends BenchmarkDriver> benchmark = IgnitePutBenchmark.class;
 
         final int threads = 1;
 
         final boolean clientDriverNode = true;
 
-        final int extraNodes = 2;
+        final int extraNodes = 4;
 
         final int warmUp = 5;
         final int duration = 5;