Repository: ignite Updated Branches: refs/heads/ignite-1093-2 80ec3457c -> 8b8ee04ea
1093 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8b8ee04e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8b8ee04e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8b8ee04e Branch: refs/heads/ignite-1093-2 Commit: 8b8ee04ea35d04ecd5becac3f80d96381f15208f Parents: 80ec345 Author: Anton Vinogradov <[email protected]> Authored: Fri Oct 16 20:48:15 2015 +0300 Committer: Anton Vinogradov <[email protected]> Committed: Fri Oct 16 20:48:15 2015 +0300 ---------------------------------------------------------------------- .../dht/preloader/GridDhtPartitionSupplier.java | 9 +++++++-- .../GridCacheRebalancingSyncSelfTest.java | 21 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/8b8ee04e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java index c7f1909..cb70e90 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java @@ -198,17 +198,22 @@ class GridDhtPartitionSupplier { cctx.io().sendOrderedMessage(cctx.localNode(), GridCachePartitionExchangeManager.rebalanceTopic(idx), d, cctx.ioPolicy(), cctx.config().getRebalanceTimeout()); - log.info("Demand request resended [current=" + cctx.affinity().affinityTopologyVersion() + ", demanded=" + d.topologyVersion() + "]"); + log.info("Demand request resended [current=" + cutTop + ", demanded=" + demTop + + ", from=" + id + ", idx=" + idx + "]"); } catch (IgniteCheckedException e) { U.error(log, "Failed to resend partition supply message to local node: " + cctx.localNode().id()); } else if (log.isDebugEnabled()) - log.info("Demand request cancelled [current=" + cctx.affinity().affinityTopologyVersion() + ", demanded=" + d.topologyVersion() + "]"); + log.info("Demand request cancelled [current=" + cutTop + ", demanded=" + demTop + + ", from=" + id + ", idx=" + idx + "]"); return; } + log.info("Demand request accepted [current=" + cutTop + ", demanded=" + demTop + + ", from=" + id + ", idx=" + idx + "]"); + GridDhtPartitionSupplyMessageV2 s = new GridDhtPartitionSupplyMessageV2( d.updateSequence(), cctx.cacheId(), d.topologyVersion()); http://git-wip-us.apache.org/repos/asf/ignite/blob/8b8ee04e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingSyncSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingSyncSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingSyncSelfTest.java index 5acc797..c066992 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingSyncSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingSyncSelfTest.java @@ -25,10 +25,12 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteNodeAttributes; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.GridCacheAdapter; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander; +import org.apache.ignite.internal.util.typedef.G; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; @@ -311,6 +313,19 @@ public class GridCacheRebalancingSyncSelfTest extends GridCommonAbstractTest { } } + protected void checkSupplyContextMapIsEmpty() { + for (Ignite g : G.allGrids()) { + for (GridCacheAdapter c : ((IgniteEx)g).context().cache().internalCaches()) { + + Object supplier = U.field(c.preloader(), "supplier"); + + Map map = U.field(supplier, "scMap"); + + assert map.isEmpty(); + } + } + } + // static{ // testTimeout = Integer.MAX_VALUE; // } @@ -363,6 +378,8 @@ public class GridCacheRebalancingSyncSelfTest extends GridCommonAbstractTest { waitForRebalancing(3, 5, 0); waitForRebalancing(4, 5, 0); + checkSupplyContextMapIsEmpty(); + //New cache should start rebalancing. CacheConfiguration<Integer, Integer> cacheRCfg = new CacheConfiguration<>(); @@ -420,6 +437,8 @@ public class GridCacheRebalancingSyncSelfTest extends GridCommonAbstractTest { waitForRebalancing(3, 5, 1); waitForRebalancing(4, 5, 1); + checkSupplyContextMapIsEmpty(); + checkData(grid(4), 0, 1); final Ignite ignite3 = grid(3); @@ -457,6 +476,8 @@ public class GridCacheRebalancingSyncSelfTest extends GridCommonAbstractTest { waitForRebalancing(4, 9); + checkSupplyContextMapIsEmpty(); + long spend = (System.currentTimeMillis() - start) / 1000; checkData(grid(4), 0, 2);
