ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntikho...@apache.org
Subject [1/3] ignite git commit: IGNITE-GG-11048 WIP
Date Thu, 24 Mar 2016 14:40:57 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-11048 [created] 041f7c2b3


IGNITE-GG-11048 WIP


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

Branch: refs/heads/ignite-11048
Commit: 27fc9d10172f1803049623a9151b8b34aa84450a
Parents: fc9730a
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Wed Mar 23 19:30:46 2016 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Wed Mar 23 19:30:46 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     | 18 +++---
 ...acheContinuousQueryRandomOperationsTest.java | 63 +++++++++++++++++++-
 .../config/GridTestProperties.java              |  4 +-
 3 files changed, 71 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/27fc9d10/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index fb6aeef..323cbd6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -2355,11 +2355,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
                 update(updated, newExpireTime, newTtl, newVer, true);
 
-                updateCntr0 = nextPartCounter(topVer);
-
-                if (updateCntr != null)
-                    updateCntr0 = updateCntr;
-
                 drReplicate(drType, updated, newVer, topVer);
 
                 recordNodeId(affNodeId, topVer);
@@ -2453,11 +2448,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
                 recordNodeId(affNodeId, topVer);
 
-                updateCntr0 = nextPartCounter(topVer);
-
-                if (updateCntr != null)
-                    updateCntr0 = updateCntr;
-
                 drReplicate(drType, null, newVer, topVer);
 
                 if (evt) {
@@ -2485,9 +2475,15 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
                 res = hadVal;
             }
 
-            if (res)
+            if (res) {
                 updateMetrics(op, metrics);
 
+                updateCntr0 = nextPartCounter(topVer);
+
+                if (updateCntr != null)
+                    updateCntr0 = updateCntr;
+            }
+
             cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary);
 
             if (intercept) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/27fc9d10/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
index cdf4ffd..3d8d455 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
@@ -31,6 +31,8 @@ import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
 import javax.cache.Cache;
 import javax.cache.configuration.Factory;
 import javax.cache.event.CacheEntryEvent;
@@ -56,6 +58,7 @@ import org.apache.ignite.cache.store.CacheStore;
 import org.apache.ignite.cache.store.CacheStoreAdapter;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.typedef.PA;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
@@ -77,6 +80,7 @@ import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
 import static org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest.ContinuousDeploy.ALL;
 import static org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest.ContinuousDeploy.CLIENT;
 import static org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest.ContinuousDeploy.SERVER;
@@ -92,7 +96,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
     private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
 
     /** */
-    private static final int NODES = 5;
+    private static final int NODES = 2;
 
     /** */
     private static final int KEYS = 50;
@@ -414,6 +418,63 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
         testContinuousQuery(ccfg, SERVER);
     }
 
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDoubleRemove() throws Exception {
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+            0,
+            ATOMIC,
+            ONHEAP_TIERED,
+            false);
+
+        try {
+            IgniteCache<Object, Object> cache = grid(0).getOrCreateCache(ccfg);
+
+            final AtomicInteger cnrt = new AtomicInteger(0);
+
+            ContinuousQuery qry = new ContinuousQuery();
+
+            final List<Object> evts = new CopyOnWriteArrayList<>();
+
+            qry.setLocalListener(new CacheEntryUpdatedListener() {
+                @Override public void onUpdated(Iterable iterable) throws CacheEntryListenerException
{
+                    for (Object o : iterable) {
+                        evts.add(o);
+
+                        cnrt.incrementAndGet();
+                    }
+                }
+            });
+
+            try (QueryCursor qryCur = cache.query(qry)) {
+                cache.put(1, 1);
+
+                cache.remove(1);
+                cache.remove(1);
+                cache.remove(1);
+                cache.remove(1);
+
+                cache.put(1, 1);
+
+                cache.remove(1);
+                cache.remove(1);
+
+                cache.put(1, 1);
+
+                assert GridTestUtils.waitForCondition(new PA() {
+                    @Override public boolean apply() {
+                        return cnrt.get() == 5;
+                    }
+                }, 5_000);
+            }
+        }
+        finally {
+            grid(0).destroyCache(ccfg.getName());
+        }
+    }
+
     /**
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/27fc9d10/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
b/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
index d13f117..7bf26b1 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
@@ -58,7 +58,7 @@ public final class GridTestProperties {
     public static final String TESTS_PROP_FILE = "tests.properties";
 
     /** */
-    public static final String TESTS_CFG_PATH = "modules/core/src/test/config";
+    public static final String TESTS_CFG_PATH = "D:\\projects\\ggprivate\\modules\\core\\src\\test\\config\\";
 
     /** */
     private static final Pattern PROP_REGEX = Pattern.compile("[@$]\\{[^@${}]+\\}");
@@ -94,7 +94,7 @@ public final class GridTestProperties {
         }
 
         // Load default properties.
-        File cfgFile = getTestConfigurationFile(null, TESTS_PROP_FILE);
+        File cfgFile = new File("D:\\projects\\ggprivate\\modules\\core\\src\\test\\config\\tests.properties");
 
         assert cfgFile.exists();
         assert !cfgFile.isDirectory();


Mime
View raw message