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-1843 More debug information.
Date Tue, 03 Nov 2015 10:14:57 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1843 3df34841f -> 7f7900052


ignite-1843 More debug information.


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

Branch: refs/heads/ignite-1843
Commit: 7f79000521c85326e570bbcfd340a36f0b4bad8b
Parents: 3df3484
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Nov 3 13:14:46 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Nov 3 13:14:46 2015 +0300

----------------------------------------------------------------------
 .../affinity/GridAffinityAssignmentCache.java   | 13 +++++++
 .../cache/GridCacheAffinityManager.java         | 10 ++++++
 .../GridCachePartitionExchangeManager.java      | 24 +++++++++++++
 .../processors/cache/GridCachePreloader.java    |  5 +++
 .../cache/GridCachePreloaderAdapter.java        |  5 +++
 .../dht/preloader/GridDhtPreloader.java         | 37 ++++++++++++++++++++
 6 files changed, 94 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7f790005/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 18776a4..8bc40cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -41,6 +41,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMa
 import org.apache.ignite.internal.processors.cache.GridCacheInternal;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 import org.jsr166.ConcurrentLinkedHashMap;
@@ -409,6 +410,18 @@ public class GridAffinityAssignmentCache {
     }
 
     /**
+     * Dumps debug information.
+     */
+    public void dumpDebugInfo() {
+        if (!readyFuts.isEmpty()) {
+            U.warn(log, "Pending affinity ready futures [cache=" + cacheName + "]:");
+
+            for (AffinityReadyFuture fut : readyFuts.values())
+                U.warn(log, ">>> " + fut);
+        }
+    }
+
+    /**
      * Get cached affinity for specified topology version.
      *
      * @param topVer Topology version.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f790005/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
index 5c43205..eddffea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
@@ -384,4 +384,14 @@ public class GridCacheAffinityManager extends GridCacheManagerAdapter
{
     public AffinityTopologyVersion affinityTopologyVersion() {
         return aff.lastVersion();
     }
+
+    /**
+     * Dumps debug information.
+     */
+    public void dumpDebugInfo() {
+        GridAffinityAssignmentCache aff0 = aff;
+
+        if (aff0 != null)
+            aff0.dumpDebugInfo();
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f790005/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 adc2174..c8ee6e3 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
@@ -992,6 +992,13 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
         for (GridDhtPartitionsExchangeFuture fut : exchWorker.futQ)
             U.warn(log, ">>> " + fut);
 
+        if (!readyFuts.isEmpty()) {
+            U.warn(log, "Pending affinity ready futures:");
+
+            for (AffinityReadyFuture fut : readyFuts.values())
+                U.warn(log, ">>> " + fut);
+        }
+
         ExchangeFutureSet exchFuts = this.exchFuts;
 
         if (exchFuts != null) {
@@ -1041,6 +1048,23 @@ public class GridCachePartitionExchangeManager<K, V> extends
GridCacheSharedMana
             for (GridCacheFuture<?> fut : mvcc.atomicFutures())
                 U.warn(log, ">>> " + fut);
         }
+
+        for (GridCacheContext ctx : cctx.cacheContexts()) {
+            if (ctx.isLocal())
+                continue;
+
+            GridCacheContext ctx0 = ctx.isNear() ? ctx.near().dht().context() : ctx;
+
+            GridCachePreloader preloader = ctx0.preloader();
+
+            if (preloader != null)
+                preloader.dumpDebugInfo();
+
+            GridCacheAffinityManager affMgr = ctx0.affinity();
+
+            if (affMgr != null)
+                affMgr.dumpDebugInfo();
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f790005/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
index 755958e..1edaef2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
@@ -132,4 +132,9 @@ public interface GridCachePreloader {
      * Unwinds undeploys.
      */
     public void unwindUndeploys();
+
+    /**
+     * Dumps debug information.
+     */
+    public void dumpDebugInfo();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f790005/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
index 5405449..4ec6749 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
@@ -146,4 +146,9 @@ public class GridCachePreloaderAdapter implements GridCachePreloader {
     @Override public void addAssignments(GridDhtPreloaderAssignments assignments, boolean
forcePreload) {
         // No-op.
     }
+
+    /** {@inheritDoc} */
+    @Override public void dumpDebugInfo() {
+        // No-op.
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f790005/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 356a85b..fe85968 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -96,6 +96,9 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
     private ConcurrentMap<AffinityTopologyVersion, GridDhtAssignmentFetchFuture> pendingAssignmentFetchFuts
=
         new ConcurrentHashMap8<>();
 
+    /** Stop flag. */
+    private volatile boolean stopping;
+
     /** Discovery listener. */
     private final GridLocalEventListener discoLsnr = new GridLocalEventListener() {
         @Override public void onEvent(Event evt) {
@@ -218,6 +221,8 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
         if (log.isDebugEnabled())
             log.debug("DHT rebalancer onKernalStop callback.");
 
+        stopping = true;
+
         cctx.events().removeListener(discoLsnr);
 
         // Acquire write busy lock.
@@ -229,6 +234,11 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
         if (demandPool != null)
             demandPool.stop();
 
+        IgniteCheckedException err = stopError();
+
+        for (GridDhtForceKeysFuture fut : forceKeyFuts.values())
+            fut.onDone(err);
+
         top = null;
     }
 
@@ -595,6 +605,9 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
      */
     void addFuture(GridDhtForceKeysFuture<?, ?> fut) {
         forceKeyFuts.put(fut.futureId(), fut);
+
+        if (stopping)
+            fut.onDone(stopError());
     }
 
     /**
@@ -607,6 +620,30 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
     }
 
     /**
+     * @return Node stop exception.
+     */
+    private IgniteCheckedException stopError() {
+        return new IgniteCheckedException("Operation has been cancelled (cache or node is
stopping).");
+    }
+
+    /** {@inheritDoc} */
+    @Override public void dumpDebugInfo() {
+        if (!forceKeyFuts.isEmpty()) {
+            U.warn(log, "Pending force key futures [cache=" + cctx.name() +"]:");
+
+            for (GridDhtForceKeysFuture fut : forceKeyFuts.values())
+                U.warn(log, ">>> " + fut);
+        }
+
+        if (!pendingAssignmentFetchFuts.isEmpty()) {
+            U.warn(log, "Pending assignment fetch futures [cache=" + cctx.name() +"]:");
+
+            for (GridDhtAssignmentFetchFuture fut : pendingAssignmentFetchFuts.values())
+                U.warn(log, ">>> " + fut);
+        }
+    }
+
+    /**
      *
      */
     private abstract class MessageHandler<M> implements IgniteBiInClosure<UUID,
M> {


Mime
View raw message