Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 43BBD200CA3 for ; Thu, 1 Jun 2017 18:19:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 409BF160BC4; Thu, 1 Jun 2017 16:19:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 60A6D160BB5 for ; Thu, 1 Jun 2017 18:18:59 +0200 (CEST) Received: (qmail 56959 invoked by uid 500); 1 Jun 2017 16:18:58 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 56949 invoked by uid 99); 1 Jun 2017 16:18:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jun 2017 16:18:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7D698DFDC8; Thu, 1 Jun 2017 16:18:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Message-Id: <1d7f726a4339430b9b089f25bf13c7fd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-5075' into ignite-5075-pds Date: Thu, 1 Jun 2017 16:18:58 +0000 (UTC) archived-at: Thu, 01 Jun 2017 16:19:00 -0000 Repository: ignite Updated Branches: refs/heads/ignite-5075-pds b4cc644d5 -> e1fd618a5 Merge remote-tracking branch 'remotes/origin/ignite-5075' into ignite-5075-pds # Conflicts: # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java # modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e1fd618a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e1fd618a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e1fd618a Branch: refs/heads/ignite-5075-pds Commit: e1fd618a53c95fe7d0e2cf3e767bf239c331c754 Parents: b4cc644 Author: sboikov Authored: Thu Jun 1 19:18:49 2017 +0300 Committer: sboikov Committed: Thu Jun 1 19:18:49 2017 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheProcessor.java | 34 +++++------- .../IgnitePersistentStoreCacheGroupsTest.java | 55 +++++++++++++++++++- 2 files changed, 67 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/e1fd618a/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 42f8b00..45e6a8b 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 @@ -2112,11 +2112,12 @@ public class GridCacheProcessor extends GridProcessorAdapter { } if (exchActions != null && (err == null || forceClose)) { - Collection> stopped = null; + Collection> stoppedGrps = null; - GridCacheContext stopCtx = null; - boolean destroy = false; for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) { + GridCacheContext stopCtx; + boolean destroy; + stopGateway(action.request()); sharedCtx.database().checkpointReadLock(); @@ -2129,11 +2130,11 @@ public class GridCacheProcessor extends GridProcessorAdapter { sharedCtx.database().checkpointReadUnlock(); } - if (stopCtx != null) { - if (stopped == null) - stopped = new ArrayList<>(); + if (stopCtx != null && !stopCtx.group().hasCaches()) { + if (stoppedGrps == null) + stoppedGrps = new ArrayList<>(); - stopped.add(F.t(stopCtx.group(), destroy)); + stoppedGrps.add(F.t(stopCtx.group(), destroy)); } } @@ -2162,12 +2163,13 @@ public class GridCacheProcessor extends GridProcessorAdapter { sharedCtx.database().checkpointReadLock(); try { - stopCtx = prepareCacheStop(req.request(), forceClose); + GridCacheContext stopCtx = prepareCacheStop(req.request(), forceClose); - destroy = req.request().destroy(); + if (stopCtx != null && !stopCtx.group().hasCaches()) { + assert !stopCtx.group().affinityNode() : stopCtx.name(); - if (stopCtx != null && !stopCtx.group().hasCaches()) stopCacheGroup(stopCtx.groupId()); + } } finally { @@ -2176,20 +2178,12 @@ public class GridCacheProcessor extends GridProcessorAdapter { } } - // TODO IGNITE-5075 group descriptors. - if (stopCtx != null) { - if (stopped == null) - stopped = new ArrayList<>(); - - stopped.add(F.t(stopCtx.group(), destroy)); - } - if (forceClose) completeCacheStartFuture(req.request(), false, err); } - if (stopped != null && !sharedCtx.kernalContext().clientNode()) - sharedCtx.database().onCacheGroupsStopped(stopped); + if (stoppedGrps != null && !sharedCtx.kernalContext().clientNode()) + sharedCtx.database().onCacheGroupsStopped(stoppedGrps); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/e1fd618a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheGroupsTest.java ---------------------------------------------------------------------- diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheGroupsTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheGroupsTest.java index 3165011..98e9f43 100644 --- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheGroupsTest.java +++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheGroupsTest.java @@ -74,13 +74,20 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest super.beforeTestsStarted(); System.setProperty(FileWriteAheadLogManager.IGNITE_PDS_WAL_MODE, "LOG_ONLY"); - - GridTestUtils.deleteDbFiles(); } /** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { System.clearProperty(FileWriteAheadLogManager.IGNITE_PDS_WAL_MODE); + + GridTestUtils.deleteDbFiles(); + } + + /** {@inheritDoc} */ + @Override protected void beforeTest() throws Exception { + super.beforeTest(); + + GridTestUtils.deleteDbFiles(); } /** {@inheritDoc} */ @@ -286,6 +293,50 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest } /** + * @throws Exception If failed. + */ + public void testCreateDropCache1() throws Exception { + CacheConfiguration ccfg1 = cacheConfiguration(GROUP1, "c1", PARTITIONED, ATOMIC, 1); + + CacheConfiguration ccfg2 = cacheConfiguration(GROUP1, "c2", PARTITIONED, ATOMIC, 1); + + Ignite ignite = startGrid(); + + ignite.createCaches(Arrays.asList(ccfg1, ccfg2)); + + + ignite.cache("c1").destroy(); + + ignite.cache("c2").destroy(); + + ignite.createCache(ccfg1); + ignite.createCache(ccfg2); + + stopGrid(); + } + + /** + * @throws Exception If failed. + */ + public void testCreateDropCache2() throws Exception { + CacheConfiguration ccfg1 = cacheConfiguration(GROUP1, "c1", PARTITIONED, ATOMIC, 1) + .setIndexedTypes(Integer.class, Person.class); + + CacheConfiguration ccfg2 = cacheConfiguration(GROUP1, "c2", PARTITIONED, ATOMIC, 1) + .setIndexedTypes(Integer.class, Person.class); + + Ignite ignite = startGrid(); + + ignite.createCaches(Arrays.asList(ccfg1, ccfg2)); + + ignite.cache("c1").destroy(); + + ignite.createCache(ccfg1); + + stopGrid(); + } + + /** * @param caches Cache names to put data into. * @param node Ignite node. */