ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject ignite git commit: IGNITE-7502 Disabled BLT for non-persistent caches
Date Thu, 25 Jan 2018 08:00:35 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 32ebec351 -> 7b29f1dbc


IGNITE-7502 Disabled BLT for non-persistent caches


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

Branch: refs/heads/master
Commit: 7b29f1dbcf377653aea367876c55d8f90d43533b
Parents: 32ebec3
Author: Ilya Lantukh <ilantukh@gridgain.com>
Authored: Thu Jan 25 11:00:25 2018 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Jan 25 11:00:25 2018 +0300

----------------------------------------------------------------------
 .../affinity/GridAffinityAssignmentCache.java   | 10 +++++--
 .../cache/CacheAffinitySharedManager.java       |  3 ++-
 .../processors/cache/CacheGroupContext.java     |  3 ++-
 .../distributed/CacheBaselineTopologyTest.java  | 28 ++++++++++++++++++++
 4 files changed, 40 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7b29f1db/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index dd46246..dd51aed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -107,6 +107,9 @@ public class GridAffinityAssignmentCache {
     /** */
     private final boolean locCache;
 
+    /** */
+    private final boolean persistentCache;
+
     /** Node stop flag. */
     private volatile IgniteCheckedException stopErr;
 
@@ -137,7 +140,8 @@ public class GridAffinityAssignmentCache {
         AffinityFunction aff,
         IgnitePredicate<ClusterNode> nodeFilter,
         int backups,
-        boolean locCache)
+        boolean locCache,
+        boolean persistentCache)
     {
         assert ctx != null;
         assert aff != null;
@@ -151,6 +155,7 @@ public class GridAffinityAssignmentCache {
         this.grpId = grpId;
         this.backups = backups;
         this.locCache = locCache;
+        this.persistentCache = persistentCache;
 
         log = ctx.log(GridAffinityAssignmentCache.class);
 
@@ -290,7 +295,8 @@ public class GridAffinityAssignmentCache {
         boolean changedBaseline = false;
 
         if (discoCache != null) {
-            hasBaseline = discoCache.state().baselineTopology() != null;
+            hasBaseline = discoCache.state().baselineTopology() != null && persistentCache;
+
             changedBaseline = !hasBaseline ? baselineTopology != null :
                 !discoCache.state().baselineTopology().equals(baselineTopology);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7b29f1db/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index 921701a..9eff560 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -2459,7 +2459,8 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                 affFunc,
                 ccfg.getNodeFilter(),
                 ccfg.getBackups(),
-                ccfg.getCacheMode() == LOCAL);
+                ccfg.getCacheMode() == LOCAL,
+                grpDesc.persistenceEnabled());
 
             return new CacheGroupHolder2(ccfg.getRebalanceMode() != NONE, cctx, aff, initAff);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7b29f1db/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
index 246f298..b980d5c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupContext.java
@@ -857,7 +857,8 @@ public class CacheGroupContext {
             ccfg.getAffinity(),
             ccfg.getNodeFilter(),
             ccfg.getBackups(),
-            ccfg.getCacheMode() == LOCAL);
+            ccfg.getCacheMode() == LOCAL,
+            persistenceEnabled());
 
         if (ccfg.getCacheMode() != LOCAL) {
             top = new GridDhtPartitionTopologyImpl(ctx, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7b29f1db/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
index 7dc1bfa..857d3a1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
@@ -105,6 +105,13 @@ public class CacheBaselineTopologyTest extends GridCommonAbstractTest
{
                     .setMaxSize(100 * 1024 * 1024)
                     .setInitialSize(100 * 1024 * 1024)
             )
+            .setDataRegionConfigurations(
+                new DataRegionConfiguration()
+                .setName("memory")
+                .setPersistenceEnabled(false)
+                .setMaxSize(100 * 1024 * 1024)
+                .setInitialSize(100 * 1024 * 1024)
+            )
             .setWalMode(WALMode.LOG_ONLY)
         );
 
@@ -739,6 +746,27 @@ public class CacheBaselineTopologyTest extends GridCommonAbstractTest
{
             assertEquals("k=" + k, Integer.valueOf(k), cache.get(k));
     }
 
+    /**
+     * @throws Exception If failed.
+     */
+    public void testNonPersistentCachesIgnoreBaselineTopology() throws Exception {
+        Ignite ig = startGrids(4);
+
+        ig.cluster().active(true);
+
+        IgniteCache persistentCache = ig.createCache(CACHE_NAME);
+
+        IgniteCache inMemoryCache = ig.createCache(
+            new CacheConfiguration<>().setName(CACHE_NAME + 2).setDataRegionName("memory"));
+
+        Ignite newNode = startGrid(4);
+
+        awaitPartitionMapExchange();
+
+        assertEquals(0, ig.affinity(persistentCache.getName()).allPartitions(newNode.cluster().localNode()).length);
+        assertTrue(ig.affinity(inMemoryCache.getName()).allPartitions(newNode.cluster().localNode()).length
> 0);
+    }
+
     /** */
     private Collection<BaselineNode> baselineNodes(Collection<ClusterNode> clNodes)
{
         Collection<BaselineNode> res = new ArrayList<>(clNodes.size());


Mime
View raw message