Repository: ignite Updated Branches: refs/heads/ignite-3478 f0b9af45b -> d26266456
ignite-6149 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2626645 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2626645 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2626645 Branch: refs/heads/ignite-3478 Commit: d26266456d623ca2c82c42dbcdb0a54757c63a26 Parents: f0b9af4 Author: sboikov <[email protected]> Authored: Wed Sep 20 18:02:57 2017 +0300 Committer: sboikov <[email protected]> Committed: Wed Sep 20 18:02:57 2017 +0300 ---------------------------------------------------------------------- .../processors/cache/CacheGroupContext.java | 6 ++++-- .../processors/cache/ClusterCachesInfo.java | 16 ++++++++++------ .../processors/cache/GridCacheProcessor.java | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d2626645/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 6e29dcc..b28e115 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 @@ -200,16 +200,18 @@ public class CacheGroupContext { caches = new ArrayList<>(); - mvccEnabled = mvccEnabled(ctx.gridConfig(), ccfg); + mvccEnabled = mvccEnabled(ctx.gridConfig(), ccfg, cacheType); } /** * @param cfg Ignite configuration. * @param ccfg Cache configuration. + * @param cacheType Cache typr. * @return {@code True} if mvcc is enabled for given cache. */ - public static boolean mvccEnabled(IgniteConfiguration cfg, CacheConfiguration ccfg) { + public static boolean mvccEnabled(IgniteConfiguration cfg, CacheConfiguration ccfg, CacheType cacheType) { return cfg.isMvccEnabled() && + cacheType == CacheType.USER && ccfg.getCacheMode() != LOCAL && ccfg.getAtomicityMode() == TRANSACTIONAL; } http://git-wip-us.apache.org/repos/asf/ignite/blob/d2626645/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index fb8416c..9d2ed41 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -137,7 +137,7 @@ class ClusterCachesInfo { if (ccfg == null) grpCfgs.put(info.cacheData().config().getGroupName(), info.cacheData().config()); else - validateCacheGroupConfiguration(ccfg, info.cacheData().config()); + validateCacheGroupConfiguration(ccfg, info.cacheData().config(), info.cacheType()); } String conflictErr = processJoiningNode(joinDiscoData, ctx.localNodeId(), true); @@ -210,7 +210,7 @@ class ClusterCachesInfo { } if (checkConsistency) - validateStartCacheConfiguration(locCfg); + validateStartCacheConfiguration(locCfg, cacheData.cacheType()); } } @@ -1523,16 +1523,17 @@ class ClusterCachesInfo { /** * @param ccfg Cache configuration to start. + * @param cacheType Cache type. * @throws IgniteCheckedException If failed. */ - public void validateStartCacheConfiguration(CacheConfiguration ccfg) throws IgniteCheckedException { + void validateStartCacheConfiguration(CacheConfiguration ccfg, CacheType cacheType) throws IgniteCheckedException { if (ccfg.getGroupName() != null) { CacheGroupDescriptor grpDesc = cacheGroupByName(ccfg.getGroupName()); if (grpDesc != null) { assert ccfg.getGroupName().equals(grpDesc.groupName()); - validateCacheGroupConfiguration(grpDesc.config(), ccfg); + validateCacheGroupConfiguration(grpDesc.config(), ccfg, cacheType); } } } @@ -1540,9 +1541,10 @@ class ClusterCachesInfo { /** * @param cfg Existing configuration. * @param startCfg Cache configuration to start. + * @param cacheType Cache type. * @throws IgniteCheckedException If validation failed. */ - private void validateCacheGroupConfiguration(CacheConfiguration cfg, CacheConfiguration startCfg) + private void validateCacheGroupConfiguration(CacheConfiguration cfg, CacheConfiguration startCfg, CacheType cacheType) throws IgniteCheckedException { GridCacheAttributes attr1 = new GridCacheAttributes(cfg); GridCacheAttributes attr2 = new GridCacheAttributes(startCfg); @@ -1551,7 +1553,9 @@ class ClusterCachesInfo { cfg.getCacheMode(), startCfg.getCacheMode(), true); CU.validateCacheGroupsAttributesMismatch(log, cfg, startCfg, "mvccEnabled", "MVCC mode", - CacheGroupContext.mvccEnabled(ctx.config(), cfg), CacheGroupContext.mvccEnabled(ctx.config(), startCfg), true); + CacheGroupContext.mvccEnabled(ctx.config(), cfg, cacheType), + CacheGroupContext.mvccEnabled(ctx.config(), startCfg, cacheType), + true); CU.validateCacheGroupsAttributesMismatch(log, cfg, startCfg, "affinity", "Affinity function", attr1.cacheAffinityClassName(), attr2.cacheAffinityClassName(), true); http://git-wip-us.apache.org/repos/asf/ignite/blob/d2626645/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java index a13a965..6ef78db 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java @@ -2818,7 +2818,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { CacheConfiguration ccfg = req.startCacheConfiguration(); try { - cachesInfo.validateStartCacheConfiguration(ccfg); + cachesInfo.validateStartCacheConfiguration(ccfg, req.cacheType()); } catch (IgniteCheckedException e) { fut.onDone(e);
