GG-12408: Backport [GG-12385] and reproducing tests to 8.1.2
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fbf95975 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fbf95975 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fbf95975 Branch: refs/heads/ignite-2.1 Commit: fbf9597570211209f968d802e91efd997acf49e6 Parents: f4f8562 Author: Ivan Rakov <[email protected]> Authored: Mon Jul 3 18:01:14 2017 +0300 Committer: Ivan Rakov <[email protected]> Committed: Mon Jul 3 18:01:14 2017 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheProcessor.java | 20 +++++++++++++++++--- .../service/GridServiceProcessor.java | 9 ++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/fbf95975/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 c425bfb..cbbfca0 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 @@ -2114,9 +2114,12 @@ public class GridCacheProcessor extends GridProcessorAdapter { ) { initCacheProxies(topVer, err); - if (exchActions != null && exchActions.systemCachesStarting() && exchActions.newClusterState() == null) + if (exchActions != null && exchActions.systemCachesStarting() && exchActions.newClusterState() == null) { ctx.dataStructures().restoreStructuresState(ctx); + ctx.service().updateUtilityCache(); + } + if (exchActions != null && err == null) { Collection<IgniteBiTuple<CacheGroupContext, Boolean>> stoppedGrps = null; @@ -2601,7 +2604,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { */ public IgniteInternalFuture<?> dynamicStartCaches(Collection<CacheConfiguration> ccfgList, boolean failIfExists, boolean checkThreadTx) { - return dynamicStartCaches(ccfgList, CacheType.USER, failIfExists, checkThreadTx); + return dynamicStartCaches(ccfgList, null, failIfExists, checkThreadTx); } /** @@ -2627,11 +2630,22 @@ public class GridCacheProcessor extends GridProcessorAdapter { try { for (CacheConfiguration ccfg : ccfgList) { + CacheType ct = cacheType; + + if (ct == null) { + if (CU.isUtilityCache(ccfg.getName())) + ct = CacheType.UTILITY; + else if (internalCaches.contains(ccfg.getName())) + ct = CacheType.INTERNAL; + else + ct = CacheType.USER; + } + DynamicCacheChangeRequest req = prepareCacheChangeRequest( ccfg, ccfg.getName(), null, - cacheType, + ct, false, failIfExists, true http://git-wip-us.apache.org/repos/asf/ignite/blob/fbf95975/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java index 12be63b..3e77d2a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java @@ -224,7 +224,7 @@ public class GridServiceProcessor extends GridProcessorAdapter implements Ignite * @throws IgniteCheckedException If failed. */ private void onKernalStart0() throws IgniteCheckedException { - cache = ctx.cache().utilityCache(); + updateUtilityCache(); if (!ctx.clientNode()) ctx.event().addDiscoveryEventListener(topLsnr, EVTS); @@ -285,6 +285,13 @@ public class GridServiceProcessor extends GridProcessorAdapter implements Ignite log.debug("Started service processor."); } + /** + * + */ + public void updateUtilityCache() { + cache = ctx.cache().utilityCache(); + } + /** {@inheritDoc} */ @Override public void onKernalStop(boolean cancel) { if (ctx.isDaemon())
