# ignite-709
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/07b6cb59 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/07b6cb59 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/07b6cb59 Branch: refs/heads/ignite-389 Commit: 07b6cb598ddb8f6c8ca76245ffbe6c434e08f870 Parents: 2c3ce15 Author: sboikov <sboi...@gridgain.com> Authored: Fri May 29 11:26:45 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Fri May 29 11:34:51 2015 +0300 ---------------------------------------------------------------------- .../dht/preloader/GridDhtPartitionMap.java | 2 +- ...niteCacheClientNodeChangingTopologyTest.java | 6 ++ .../junits/common/GridCommonAbstractTest.java | 61 +++++++++++++++++--- 3 files changed, 60 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/07b6cb59/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java index facf7e3..faa6cf6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java @@ -237,7 +237,7 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext * @return Full string representation. */ public String toFullString() { - return S.toString(GridDhtPartitionMap.class, this, "size", size(), "map", super.toString()); + return S.toString(GridDhtPartitionMap.class, this, "size", size(), "map", map.toString()); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/07b6cb59/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java index 47c1d7e..922e618 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java @@ -1556,6 +1556,9 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac catch (TimeoutException e) { log.error("Failed to wait for update."); + for (Ignite ignite : G.allGrids()) + dumpCacheDebugInfo(ignite); + U.dumpThreads(log); CyclicBarrier barrier0 = updateBarrier; @@ -1593,6 +1596,9 @@ public class IgniteCacheClientNodeChangingTopologyTest extends GridCommonAbstrac catch (TimeoutException e) { log.error("Failed to wait for update."); + for (Ignite ignite : G.allGrids()) + dumpCacheDebugInfo(ignite); + U.dumpThreads(log); CyclicBarrier barrier0 = updateBarrier; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/07b6cb59/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java index 1f4c7b6..cded7fa 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.*; import org.apache.ignite.internal.processors.cache.distributed.dht.colocated.*; import org.apache.ignite.internal.processors.cache.distributed.near.*; import org.apache.ignite.internal.processors.cache.local.*; +import org.apache.ignite.internal.processors.cache.transactions.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; @@ -383,19 +384,31 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest { int actual = owners.size(); if (affNodes.size() != owners.size() || !affNodes.containsAll(owners)) { - LT.warn(log(), null, "Waiting for topology map update [grid=" + g.name() + - ", cache=" + cfg.getName() + ", p=" + p + ", nodes=" + exp + ", owners=" + actual + - ", affNodes=" + affNodes + ", owners=" + owners + - ", locNode=" + g.cluster().localNode().id() + ']'); + LT.warn(log(), null, "Waiting for topology map update [" + + "grid=" + g.name() + + ", cache=" + cfg.getName() + + ", cacheId=" + dht.context().cacheId() + + ", p=" + p + + ", affNodesCnt=" + exp + + ", ownersCnt=" + actual + + ", affNodes=" + affNodes + + ", owners=" + owners + + ", locNode=" + g.cluster().localNode() + ']'); if (i == 0) start = System.currentTimeMillis(); if (System.currentTimeMillis() - start > 30_000) - throw new IgniteException("Timeout of waiting for topology map update [grid=" - + g.name() + ", p=" + p + ", nodes=" + exp + ", owners=" + actual + - ", affNodes=" + affNodes + ", owners=" + owners + ", locNode=" - + g.cluster().localNode().id() + ']'); + throw new IgniteException("Timeout of waiting for topology map update [" + + "grid=" + g.name() + + ", cache=" + cfg.getName() + + ", cacheId=" + dht.context().cacheId() + + ", p=" + p + + ", affNodesCnt=" + exp + + ", ownersCnt=" + actual + + ", affNodes=" + affNodes + + ", owners=" + owners + + ", locNode=" + g.cluster().localNode() + ']'); Thread.sleep(200); // Busy wait. @@ -415,6 +428,38 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest { } /** + * @param ignite Node. + */ + public void dumpCacheDebugInfo(Ignite ignite) { + GridKernalContext ctx = ((IgniteKernal)ignite).context(); + + log.error("Cache information update [node=" + ignite.name() + + ", client=" + ignite.configuration().isClientMode() + ']'); + + GridCacheSharedContext cctx = ctx.cache().context(); + + log.error("Pending transactions:"); + + for (IgniteInternalTx tx : cctx.tm().activeTransactions()) + log.error(">>> " + tx); + + log.error("Pending explicit locks:"); + + for (GridCacheExplicitLockSpan lockSpan : cctx.mvcc().activeExplicitLocks()) + log.error(">>> " + lockSpan); + + log.error("Pending cache futures:"); + + for (GridCacheFuture<?> fut : cctx.mvcc().activeFutures()) + log.error(">>> " + fut); + + log.error("Pending atomic cache futures:"); + + for (GridCacheFuture<?> fut : cctx.mvcc().atomicFutures()) + log.error(">>> " + fut); + } + + /** * @param cache Cache. * @return Affinity. */