ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-5075' into ignite-5075-pds
Date Thu, 01 Jun 2017 16:18:58 GMT
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 <sboikov@gridgain.com>
Authored: Thu Jun 1 19:18:49 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
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<IgniteBiTuple<CacheGroupContext, Boolean>> stopped = null;
+            Collection<IgniteBiTuple<CacheGroupContext, Boolean>> 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.
      */


Mime
View raw message