IGNITE-8869 Fixed PartitionsExchangeOnDiscoveryHistoryOverflowTest hanging

Signed-off-by: Andrey Gura <ag...@apache.org>


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

Branch: refs/heads/ignite-8446
Commit: 641f5b425deac59062ed66f6558dd2da4a408180
Parents: 8adff24
Author: Ivan Daschinskiy <ivanda...@gmail.com>
Authored: Fri Jul 6 19:20:45 2018 +0300
Committer: Andrey Gura <ag...@apache.org>
Committed: Fri Jul 6 19:20:45 2018 +0300

----------------------------------------------------------------------
 .../dht/preloader/latch/ExchangeLatchManager.java         | 10 +++++-----
 .../PartitionsExchangeOnDiscoveryHistoryOverflowTest.java |  4 +---
 2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/641f5b42/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
index ab5819d..33c0861 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
@@ -46,6 +46,7 @@ import 
org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteProductVersion;
 import org.jetbrains.annotations.Nullable;
@@ -241,13 +242,12 @@ public class ExchangeLatchManager {
         if (topVer == AffinityTopologyVersion.NONE)
             return discovery.aliveServerNodes();
         else {
-            DiscoCache discoCache = discovery.discoCache(topVer);
+            Collection<ClusterNode> histNodes = 
discovery.topology(topVer.topologyVersion());
 
-            if (discoCache != null)
-                return discoCache.aliveServerNodes();
+            if (histNodes != null)
+                return histNodes.stream().filter(n -> !CU.clientNode(n) && 
discovery.alive(n)).collect(Collectors.toSet());
             else
-                throw new IgniteException("DiscoCache not found for topology "
-                    + topVer
+                throw new IgniteException("Topology " +topVer + " not found in 
discovery history "
                     + "; consider increasing IGNITE_DISCOVERY_HISTORY_SIZE 
property. Current value is "
                     + 
IgniteSystemProperties.getInteger(IgniteSystemProperties.IGNITE_DISCOVERY_HISTORY_SIZE,
 -1));
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/641f5b42/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeOnDiscoveryHistoryOverflowTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeOnDiscoveryHistoryOverflowTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeOnDiscoveryHistoryOverflowTest.java
index 06d8da8..c0896c8 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeOnDiscoveryHistoryOverflowTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeOnDiscoveryHistoryOverflowTest.java
@@ -46,7 +46,7 @@ import static 
org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVE
  */
 public class PartitionsExchangeOnDiscoveryHistoryOverflowTest extends 
IgniteCacheAbstractTest {
     /** */
-    private static final int CACHES_COUNT = 50;
+    private static final int CACHES_COUNT = 30;
 
     /** */
     private static final int DISCOVERY_HISTORY_SIZE = 10;
@@ -122,8 +122,6 @@ public class 
PartitionsExchangeOnDiscoveryHistoryOverflowTest extends IgniteCach
      * @throws Exception In case of error.
      */
     public void testDynamicCacheCreation() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-8869";);
-
         for (int iter = 0; iter < 5; iter++) {
             log.info("Iteration: " + iter);
 

Reply via email to