IGNITE-10794: MVCC: RemoveAll is broken on unstable topology. This closes #5733.
authorIgor Seliverstov <gvvinblade@gmail.com>
Fri, 11 Jan 2019 13:36:25 +0000 (16:36 +0300)
committerIgor Seliverstov <gvvinblade@gmail.com>
Fri, 11 Jan 2019 13:36:25 +0000 (16:36 +0300)
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxAbstractEnlistFuture.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPreloadAbstractTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryAsyncFailoverMvccTxSelfTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverMvccTxSelfTest.java

index 899417d..368e5c4 100644 (file)
@@ -1263,7 +1263,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
         updRes.newValue(res.newValue());
 
-        if (invoke) {
+        if (invoke && res.resultType() != ResultType.VERSION_FOUND) {
             assert res.invokeResult() != null;
 
             updRes.invokeResult(res.invokeResult());
index 936758d..7b9c29c 100644 (file)
@@ -1146,16 +1146,17 @@ public abstract class GridDhtTxAbstractEnlistFuture<T> extends GridCacheFutureAd
             if (keys == null)
                 keys = new ArrayList<>();
 
-            keys.add(key);
-
-            if (val != null) {
-                if (vals == null)
-                    vals = new ArrayList<>();
+            if (vals == null && val != null) {
+                vals = new ArrayList<>(U.ceilPow2(keys.size() + 1));
 
-                vals.add(val);
+                while (vals.size() != keys.size())
+                    vals.add(null); // Init vals with missed 'nulls'.
             }
 
-            assert (vals == null) || keys.size() == vals.size();
+            keys.add(key);
+
+            if (vals != null)
+                vals.add(val);
         }
 
         /**
index a9e6e47..9b9c7cc 100644 (file)
@@ -1904,7 +1904,7 @@ public class IgniteTxHandler {
                             invokeArgs = invokeVal.invokeArgs();
                         }
 
-                        assert entryProc != null || !op.isInvoke() : "entryProc=" + entryProc + ", op=" + op;
+                        assert entries != null || entryProc != null || !op.isInvoke() : "entryProc=" + entryProc + ", op=" + op;
 
                         GridDhtCacheEntry entry = dht.entryExx(key, tx.topologyVersion());
 
index 1f144f0..7bccecf 100644 (file)
@@ -77,9 +77,6 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
     /** @throws Exception If failed. */
     @Test
     public void testAtomicLongPartitioned() throws Exception {
-        if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10391");
-
         mode = CacheMode.PARTITIONED;
 
         startGrids(2);
@@ -95,9 +92,6 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
     /** @throws Exception If failed. */
     @Test
     public void testAtomicLongReplicated() throws Exception {
-        if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10391");
-
         mode = CacheMode.REPLICATED;
 
         startGrids(2);
index d3c7190..a86c9b3 100644 (file)
@@ -40,7 +40,6 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.GridTestUtils.SF;
-import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.jetbrains.annotations.Nullable;
 import org.junit.Test;
@@ -138,9 +137,6 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
      */
     @Test
     public void testEntryProcessorNodeLeave() throws Exception {
-        if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10254");
-
         startGrid(GRID_CNT);
 
         // TODO: IGNITE-1525 (test fails with one-phase commit).
@@ -212,9 +208,6 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     private void checkEntryProcessorNodeJoin(boolean invokeAll) throws Exception {
-        if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10391");
-
         final AtomicBoolean stop = new AtomicBoolean();
         final AtomicReference<Throwable> error = new AtomicReference<>();
         final int started = 6;
index 30b1dda..296e5ef 100644 (file)
@@ -2100,7 +2100,7 @@ public class CacheLateAffinityAssignmentTest extends GridCommonAbstractTest {
     @Test
     public void testNoForceKeysRequests() throws Exception {
         if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10391");
+            fail("https://issues.apache.org/jira/browse/IGNITE-10604");
 
         cacheC = new IgniteClosure<String, CacheConfiguration[]>() {
             @Override public CacheConfiguration[] apply(String s) {
index c9f903e..26a04af 100644 (file)
@@ -84,9 +84,6 @@ public abstract class IgniteTxPreloadAbstractTest extends GridCacheAbstractSelfT
      */
     @Test
     public void testRemoteTxPreloading() throws Exception {
-        if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10391");
-
         IgniteCache<String, Integer> cache = jcache(0);
 
         for (int i = 0; i < 10_000; i++)
@@ -166,9 +163,6 @@ public abstract class IgniteTxPreloadAbstractTest extends GridCacheAbstractSelfT
      */
     @Test
     public void testLocalTxPreloadingPessimistic() throws Exception {
-        if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10391");
-
         testLocalTxPreloading(PESSIMISTIC);
     }
 
index f342d4c..ac28128 100644 (file)
@@ -50,10 +50,4 @@ public class CacheContinuousQueryAsyncFailoverMvccTxSelfTest  extends CacheConti
     @Override public void testBackupQueueEvict() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-7311");
     }
-
-    /** {@inheritDoc} */
-    @Test
-    @Override public void testFailoverStartStopBackup() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-10391");
-    }
 }
index b9972ee..68bf146 100644 (file)
@@ -45,10 +45,4 @@ public class CacheContinuousQueryFailoverMvccTxSelfTest extends CacheContinuousQ
     @Override public void testBackupQueueEvict() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-7311");
     }
-
-    /** {@inheritDoc} */
-    @Test
-    @Override public void testFailoverStartStopBackup() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-10391");
-    }
 }