You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/05/29 14:46:57 UTC
[50/50] incubator-ignite git commit: # ignite-929 skip exchange for
client cache close
# ignite-929 skip exchange for client cache close
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4c296de6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4c296de6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4c296de6
Branch: refs/heads/ignite-929
Commit: 4c296de6632e18256a7cfb30d247bad234cb4f16
Parents: c3a5426
Author: sboikov <sb...@gridgain.com>
Authored: Fri May 29 15:44:25 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri May 29 15:44:25 2015 +0300
----------------------------------------------------------------------
.../GridDhtPartitionsExchangeFuture.java | 13 +++++-----
...teCacheClientNodePartitionsExchangeTest.java | 26 +++++++++++++++++---
2 files changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4c296de6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 145def8..853670b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -483,17 +483,18 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
else {
assert discoEvt.type() == EVT_DISCOVERY_CUSTOM_EVT : discoEvt;
- boolean clientOnlyStart = true;
+ boolean clientOnlyCacheEvt = true;
for (DynamicCacheChangeRequest req : reqs) {
- if (!req.clientStartOnly()) {
- clientOnlyStart = false;
+ if (req.clientStartOnly() || req.close())
+ continue;
- break;
- }
+ clientOnlyCacheEvt = false;
+
+ break;
}
- clientNodeEvt = clientOnlyStart;
+ clientNodeEvt = clientOnlyCacheEvt;
}
if (clientNodeEvt) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4c296de6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodePartitionsExchangeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodePartitionsExchangeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodePartitionsExchangeTest.java
index 68ae211..5224d73 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodePartitionsExchangeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodePartitionsExchangeTest.java
@@ -464,6 +464,7 @@ public class IgniteCacheClientNodePartitionsExchangeTest extends GridCommonAbstr
/**
* @param nearCache If {@code true} creates near cache on client.
+ * @param srvNode If {@code true} creates client cache on non-client node.
* @throws Exception If failed.
*/
private void clientOnlyCacheStart(boolean nearCache, boolean srvNode) throws Exception {
@@ -497,7 +498,7 @@ public class IgniteCacheClientNodePartitionsExchangeTest extends GridCommonAbstr
spi1.reset();
spi2.reset();
- assertNull(((IgniteKernal)ignite2).context().cache().context().cache().internalCache("cache1"));
+ assertNull(((IgniteKernal)ignite2).context().cache().context().cache().internalCache(CACHE_NAME1));
if (nearCache)
ignite2.getOrCreateNearCache(CACHE_NAME1, new NearCacheConfiguration<>());
@@ -506,7 +507,7 @@ public class IgniteCacheClientNodePartitionsExchangeTest extends GridCommonAbstr
waitForTopologyUpdate(3, new AffinityTopologyVersion(3, 1));
- GridCacheAdapter cache = ((IgniteKernal)ignite2).context().cache().context().cache().internalCache("cache1");
+ GridCacheAdapter cache = ((IgniteKernal)ignite2).context().cache().context().cache().internalCache(CACHE_NAME1);
assertNotNull(cache);
assertEquals(nearCache, cache.context().isNear());
@@ -532,6 +533,25 @@ public class IgniteCacheClientNodePartitionsExchangeTest extends GridCommonAbstr
spi1.reset();
spi2.reset();
+ AffinityTopologyVersion topVer;
+
+ if (!srvNode) {
+ ignite2.cache(CACHE_NAME1).close();
+
+ assertNull(((IgniteKernal)ignite2).context().cache().context().cache().internalCache(CACHE_NAME1));
+
+ assertEquals(0, spi0.partitionsSingleMessages());
+ assertEquals(0, spi0.partitionsFullMessages());
+ assertEquals(0, spi1.partitionsSingleMessages());
+ assertEquals(0, spi1.partitionsFullMessages());
+ assertEquals(0, spi2.partitionsSingleMessages());
+ assertEquals(0, spi2.partitionsFullMessages());
+
+ topVer = new AffinityTopologyVersion(3, 3);
+ }
+ else
+ topVer = new AffinityTopologyVersion(3, 2);
+
final String CACHE_NAME2 = "cache2";
ccfg = new CacheConfiguration();
@@ -540,7 +560,7 @@ public class IgniteCacheClientNodePartitionsExchangeTest extends GridCommonAbstr
ignite2.createCache(ccfg);
- waitForTopologyUpdate(3, new AffinityTopologyVersion(3, 2));
+ waitForTopologyUpdate(3, topVer);
assertEquals(0, spi0.partitionsSingleMessages());
assertEquals(2, spi0.partitionsFullMessages());