Repository: ignite
Updated Branches:
  refs/heads/ignite-1093-2 c4b65e16b -> 813ed3755


1093


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

Branch: refs/heads/ignite-1093-2
Commit: 813ed3755260d4b33642828d2400cd70f46ed1b3
Parents: c4b65e1
Author: Anton Vinogradov <[email protected]>
Authored: Fri Oct 16 23:16:16 2015 +0300
Committer: Anton Vinogradov <[email protected]>
Committed: Fri Oct 16 23:16:16 2015 +0300

----------------------------------------------------------------------
 .../dht/preloader/GridDhtPartitionSupplier.java | 25 +++++++-------------
 .../GridCacheRebalancingAsyncSelfTest.java      | 25 ++++++++++++++++++++
 .../GridCacheRebalancingSyncSelfTest.java       | 25 --------------------
 3 files changed, 33 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/813ed375/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 26a6a8c..b070ac0 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
@@ -105,7 +105,8 @@ class GridDhtPartitionSupplier {
 
                             clearContext(sctx, log);
 
-                            U.log(log, "Supply context removed for node failed 
or left [node=" + t.get1() + "]");
+                            if (log.isDebugEnabled())
+                                log.debug("Supply context removed for failed 
or left node [node=" + t.get1() + "]");
 
                             scMap.remove(t, sctx);
                         }
@@ -190,27 +191,17 @@ class GridDhtPartitionSupplier {
         AffinityTopologyVersion cutTop = 
cctx.affinity().affinityTopologyVersion();
         AffinityTopologyVersion demTop = d.topologyVersion();
 
-        if (!cutTop.equals(demTop)) {
-            if (cutTop.compareTo(demTop) < 0)
-                // Resend demand message.
-                try {
-                    log.info("Demand request caused waiting for proper 
topology [current=" + cutTop + ", demanded=" + demTop +
-                        ", from=" + id + ", idx=" + idx + "]");
-
-                    
cctx.discovery().topologyFuture(demTop.topologyVersion()).get();
-                }
-                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=" + cutTop + ", 
demanded=" + demTop +
+        if (cutTop.compareTo(demTop) > 0) {
+            if (log.isDebugEnabled())
+                log.debug("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 + "]");
+        if (log.isDebugEnabled())
+            log.debug("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/813ed375/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingAsyncSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingAsyncSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingAsyncSelfTest.java
index f1ae72e..c65a0ed 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingAsyncSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingAsyncSelfTest.java
@@ -17,9 +17,12 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.rebalancing;
 
+import org.apache.ignite.Ignite;
 import org.apache.ignite.cache.CacheRebalanceMode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander;
+import org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi;
 
 /**
  *
@@ -35,4 +38,26 @@ public class GridCacheRebalancingAsyncSelfTest extends 
GridCacheRebalancingSyncS
 
         return iCfg;
     }
+
+    /**
+     * @throws Exception Exception.
+     */
+    public void testNodeFailedAtRebalancing() throws Exception {
+        Ignite ignite = startGrid(0);
+
+        generateData(ignite, 0, 0);
+
+        log.info("Preloading started.");
+
+        startGrid(1);
+
+        GridDhtPartitionDemander.RebalanceFuture fut = 
(GridDhtPartitionDemander.RebalanceFuture)grid(1).context().
+            
cache().internalCache(CACHE_NAME_DHT_REPLICATED).preloader().rebalanceFuture();
+
+        fut.get();
+
+        
((TestTcpDiscoverySpi)grid(1).configuration().getDiscoverySpi()).simulateNodeFailure();
+
+        checkSupplyContextMapIsEmpty();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/813ed375/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 c066992..6cd5d79 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
@@ -34,7 +34,6 @@ 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;
-import org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -508,30 +507,6 @@ public class GridCacheRebalancingSyncSelfTest extends 
GridCommonAbstractTest {
         checkData(grid(1), 0, 0);
     }
 
-    /**
-     * @throws Exception Exception.
-     */
-    public void testNodeFailedAtRebalancing() throws Exception {
-        Ignite ignite = startGrid(0);
-
-        generateData(ignite, 0, 0);
-
-        log.info("Preloading started.");
-
-        startGrid(1);
-
-        waitForRebalancing(1, 2);
-
-        startGrid(2);
-
-        waitForRebalancing(2, 3);
-
-        
((TestTcpDiscoverySpi)grid(2).configuration().getDiscoverySpi()).simulateNodeFailure();
-
-        waitForRebalancing(0, 4);
-        waitForRebalancing(1, 4);
-    }
-
     @Override protected void afterTest() throws Exception {
         super.afterTest();
 

Reply via email to