ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [05/10] ignite git commit: IGNITE-6340 Fixed incorrect client cache creation on server side. Fixes #2635
Date Thu, 14 Sep 2017 14:41:05 GMT
IGNITE-6340 Fixed incorrect client cache creation on server side. Fixes #2635


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

Branch: refs/heads/ignite-5896
Commit: b97aec704ba4dc64c1bbcd9abbd686128ed3e0f2
Parents: 9514d4a
Author: Ilya Lantukh <ilantukh@gridgain.com>
Authored: Thu Sep 14 10:44:29 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Sep 14 10:44:29 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheProcessor.java    |  2 +-
 .../cache/ConcurrentCacheStartTest.java         | 71 ++++++++++++++++++++
 .../testsuites/IgniteCacheTestSuite5.java       |  3 +
 3 files changed, 75 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b97aec70/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 5d84809..f3759e0 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
@@ -3784,7 +3784,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                             // If local node has near cache, return success.
                             req.clientStartOnly(true);
                     }
-                    else
+                    else if (!CU.affinityNode(ctx.discovery().localNode(), descCfg.getNodeFilter()))
                         req.clientStartOnly(true);
 
                     req.deploymentId(desc.deploymentId());

http://git-wip-us.apache.org/repos/asf/ignite/blob/b97aec70/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ConcurrentCacheStartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ConcurrentCacheStartTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ConcurrentCacheStartTest.java
new file mode 100644
index 0000000..1d97ed9
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ConcurrentCacheStartTest.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class ConcurrentCacheStartTest extends GridCommonAbstractTest {
+    /**
+     * @throws Exception If failed.
+     */
+    public void test() throws Exception {
+        try {
+            final IgniteEx ignite = (IgniteEx) startGrids(4);
+
+            for (int k = 0; k < 100; k++) {
+                final String cacheName = "cache" + k;
+
+                GridTestUtils.runMultiThreaded(new Runnable() {
+                    @Override public void run() {
+                        try {
+                            ignite.context().cache().dynamicStartCache(
+                                new CacheConfiguration().setName(cacheName),
+                                cacheName,
+                                null,
+                                false,
+                                false,
+                                false
+                            ).get();
+
+                            assertNotNull(ignite.context().cache().cache(cacheName));
+                        }
+                        catch (IgniteCheckedException ex) {
+                            throw new IgniteException(ex);
+                        }
+                    }
+                }, 10, "cache-start");
+            }
+        }
+        finally {
+            stopAllGrids();
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/b97aec70/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
index 38ffb4c..ee57fa7 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
@@ -30,6 +30,7 @@ import org.apache.ignite.internal.processors.cache.CacheRebalancingSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheSerializableTransactionsTest;
 import org.apache.ignite.internal.processors.cache.ClusterStatePartitionedSelfTest;
 import org.apache.ignite.internal.processors.cache.ClusterStateReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.ConcurrentCacheStartTest;
 import org.apache.ignite.internal.processors.cache.EntryVersionConsistencyReadThroughTest;
 import org.apache.ignite.internal.processors.cache.IgniteCachePutStackOverflowSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheReadThroughEvictionsVariationsSuite;
@@ -96,6 +97,8 @@ public class IgniteCacheTestSuite5 extends TestSuite {
 
         suite.addTestSuite(NotMappedPartitionInTxTest.class);
 
+        suite.addTestSuite(ConcurrentCacheStartTest.class);
+
         suite.addTestSuite(Cache64kPartitionsTest.class);
 
         return suite;


Mime
View raw message