You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by am...@apache.org on 2019/03/04 12:50:46 UTC
[ignite] branch master updated: IGNITE-9470: MVCC TX: Mvcc
transactions should throw proper exception. This closes #6131.
This is an automated email from the ASF dual-hosted git repository.
amashenkov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 6008a0a IGNITE-9470: MVCC TX: Mvcc transactions should throw proper exception. This closes #6131.
6008a0a is described below
commit 6008a0af5f8bb8051aca7cbc67878c138097d6df
Author: ipavlukhin <vo...@gmail.com>
AuthorDate: Mon Mar 4 15:50:35 2019 +0300
IGNITE-9470: MVCC TX: Mvcc transactions should throw proper exception. This closes #6131.
Signed-off-by: Andrey V. Mashenkov <an...@gmail.com>
---
.../processors/cache/GridCacheProcessor.java | 7 +
.../near/GridNearTxAbstractEnlistFuture.java | 13 ++
.../internal/util/future/GridFutureAdapter.java | 4 +-
.../GridCacheMixedPartitionExchangeSelfTest.java | 10 +-
.../GridCacheMvccMultiThreadedUpdateSelfTest.java | 49 ++++--
...OffHeapMultiThreadedUpdateAbstractSelfTest.java | 23 ++-
.../cache/IgniteClientCacheStartFailoverTest.java | 5 +-
.../IgniteMvccTxMultiThreadedAbstractTest.java | 2 -
.../processors/cache/IgniteTxAbstractTest.java | 6 +-
.../cache/IgniteTxExceptionAbstractSelfTest.java | 32 +---
...WriteSynchronizationModesMultithreadedTest.java | 29 ++--
.../dht/GridCacheColocatedTxExceptionSelfTest.java | 58 -------
...achePartitionedMvccTxMultiThreadedSelfTest.java | 5 +-
...CacheReplicatedMvccTxMultiThreadedSelfTest.java | 4 +-
.../GridCacheReplicatedTxExceptionSelfTest.java | 58 -------
.../cache/mvcc/CacheMvccTransactionsTest.java | 178 ++-------------------
.../cache/transactions/TxRollbackAsyncTest.java | 4 +-
.../ignite/testframework/MvccFeatureChecker.java | 1 -
...ransactionsCommandsWithMvccEnabledSelfTest.java | 2 +-
.../mvcc/CacheMvccPartitionedSqlQueriesTest.java | 2 +-
.../mvcc/CacheMvccReplicatedSqlQueriesTest.java | 2 +-
.../mvcc/CacheMvccSqlQueriesAbstractTest.java | 99 ++++++------
.../mvcc/CacheMvccSqlTxQueriesAbstractTest.java | 68 ++++----
.../cache/mvcc/MvccDeadlockDetectionTest.java | 4 +-
.../processors/query/h2/QueryDataPageScanTest.java | 5 +-
25 files changed, 230 insertions(+), 440 deletions(-)
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 3e3d0d4..60582a7 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
@@ -177,6 +177,8 @@ import org.apache.ignite.spi.discovery.DiscoveryDataBag;
import org.apache.ignite.spi.discovery.DiscoveryDataBag.GridDiscoveryData;
import org.apache.ignite.spi.discovery.DiscoveryDataBag.JoiningNodeDiscoveryData;
import org.apache.ignite.spi.encryption.EncryptionSpi;
+import org.apache.ignite.spi.indexing.IndexingSpi;
+import org.apache.ignite.spi.indexing.noop.NoopIndexingSpi;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -559,6 +561,11 @@ public class GridCacheProcessor extends GridProcessorAdapter {
", dataRegionName=" + memPlcName + ", pageEvictionMode=" +
dataRegion.config().getPageEvictionMode() + ']');
}
+
+ IndexingSpi idxSpi = ctx.config().getIndexingSpi();
+
+ assertParameter(idxSpi == null || idxSpi instanceof NoopIndexingSpi,
+ "Custom IndexingSpi cannot be used with TRANSACTIONAL_SNAPSHOT atomicity mode");
}
if (cc.isWriteBehindEnabled()) {
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxAbstractEnlistFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxAbstractEnlistFuture.java
index e43b5e9..89e7761 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxAbstractEnlistFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxAbstractEnlistFuture.java
@@ -41,6 +41,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLoca
import org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshot;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
+import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException;
import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.internal.S;
@@ -361,6 +362,11 @@ public abstract class GridNearTxAbstractEnlistFuture<T> extends GridCacheCompoun
}
/** {@inheritDoc} */
+ @Override public boolean onCancelled() {
+ return onDone(null, asyncRollbackException(), false);
+ }
+
+ /** {@inheritDoc} */
@Override public boolean onDone(@Nullable T res, @Nullable Throwable err, boolean cancelled) {
if (!DONE_UPD.compareAndSet(this, 0, 1))
return false;
@@ -451,6 +457,13 @@ public abstract class GridNearTxAbstractEnlistFuture<T> extends GridCacheCompoun
}
/**
+ * @return Async rollback exception.
+ */
+ @NotNull private IgniteTxRollbackCheckedException asyncRollbackException() {
+ return new IgniteTxRollbackCheckedException("Transaction was asynchronously rolled back [tx=" + tx + ']');
+ }
+
+ /**
* Start iterating the data rows and form batches.
*
* @param topLocked Whether topology was already locked.
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
index cddb19c..ea670dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
@@ -251,10 +251,10 @@ public class GridFutureAdapter<R> implements IgniteInternalFuture<R> {
* @throws IgniteCheckedException If resolved to exception.
*/
private R resolve() throws IgniteCheckedException {
- if(state == CANCELLED)
+ if (state == CANCELLED)
throw new IgniteFutureCancelledCheckedException("Future was cancelled: " + this);
- if(state == null || state.getClass() != ErrorWrapper.class)
+ if (state == null || state.getClass() != ErrorWrapper.class)
return (R)state;
throw U.cast(((ErrorWrapper)state).error);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
index 7ee0ebe..4e3f988 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMixedPartitionExchangeSelfTest.java
@@ -34,7 +34,6 @@ import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
-import org.junit.Assume;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -52,13 +51,6 @@ public class GridCacheMixedPartitionExchangeSelfTest extends GridCommonAbstractT
private boolean cache;
/** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9470", MvccFeatureChecker.forcedMvcc());
-
- super.beforeTestsStarted();
- }
-
- /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
@@ -126,7 +118,7 @@ public class GridCacheMixedPartitionExchangeSelfTest extends GridCommonAbstractT
}
catch (Exception e) {
if (!X.hasCause(e, ClusterTopologyCheckedException.class))
- throw e;
+ MvccFeatureChecker.assertMvccWriteConflict(e);
}
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccMultiThreadedUpdateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccMultiThreadedUpdateSelfTest.java
index 4e8f3d5..f48300d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccMultiThreadedUpdateSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMvccMultiThreadedUpdateSelfTest.java
@@ -18,13 +18,15 @@
package org.apache.ignite.internal.processors.cache;
import java.util.concurrent.Callable;
+import java.util.function.Supplier;
+import javax.cache.CacheException;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteTransactions;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
-import org.junit.Assume;
+import org.junit.Test;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
@@ -46,16 +48,10 @@ public class GridCacheMvccMultiThreadedUpdateSelfTest extends GridCacheOffHeapMu
return CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
}
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9470", MvccFeatureChecker.forcedMvcc());
-
- super.beforeTestsStarted();
- }
-
/**
* @throws Exception If failed.
*/
+ @Test
public void testTransformTx() throws Exception {
testTransformTx(keyForNode(0));
@@ -82,11 +78,13 @@ public class GridCacheMvccMultiThreadedUpdateSelfTest extends GridCacheOffHeapMu
if (i % 500 == 0)
log.info("Iteration " + i);
- try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.invoke(key, new IncProcessor());
+ doOperation(() -> {
+ try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ cache.invoke(key, new IncProcessor());
- tx.commit();
- }
+ tx.commit();
+ }
+ });
}
return null;
@@ -110,6 +108,7 @@ public class GridCacheMvccMultiThreadedUpdateSelfTest extends GridCacheOffHeapMu
/**
* @throws Exception If failed.
*/
+ @Test
public void testPutTxPessimistic() throws Exception {
testPutTx(keyForNode(0));
@@ -134,13 +133,16 @@ public class GridCacheMvccMultiThreadedUpdateSelfTest extends GridCacheOffHeapMu
if (i % 500 == 0)
log.info("Iteration " + i);
- try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- Integer val = cache.getAndPut(key, i);
+ int val0 = i;
+ doOperation(() -> {
+ try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ Integer val = cache.getAndPut(key, val0);
- assertNotNull(val);
+ assertNotNull(val);
- tx.commit();
- }
+ tx.commit();
+ }
+ });
}
return null;
@@ -157,6 +159,7 @@ public class GridCacheMvccMultiThreadedUpdateSelfTest extends GridCacheOffHeapMu
/**
* @throws Exception If failed.
*/
+ @Test
public void testPutxIfAbsentTxPessimistic() throws Exception {
testPutxIfAbsentTx(keyForNode(0));
@@ -200,4 +203,16 @@ public class GridCacheMvccMultiThreadedUpdateSelfTest extends GridCacheOffHeapMu
assertFalse(failed);
}
+
+ /** {@inheritDoc} */
+ @Override protected <T> T doOperation(Supplier<T> op) {
+ while (true) {
+ try {
+ return super.doOperation(op);
+ }
+ catch (CacheException e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+ }
+ }
+ }
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
index f39e495..6ece9ec 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache;
import java.io.Serializable;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Supplier;
import javax.cache.Cache;
import javax.cache.processor.EntryProcessor;
import javax.cache.processor.MutableEntry;
@@ -98,7 +99,7 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
if (i % 500 == 0)
log.info("Iteration " + i);
- cache.invoke(key, new IncProcessor());
+ doOperation(() -> cache.invoke(key, new IncProcessor()));
}
return null;
@@ -143,7 +144,8 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
if (i % 500 == 0)
log.info("Iteration " + i);
- Integer val = cache.getAndPut(key, i);
+ int val0 = i;
+ Integer val = doOperation(() -> cache.getAndPut(key, val0));
assertNotNull(val);
}
@@ -235,7 +237,8 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
if (i % 1000 == 0)
log.info("Put iteration " + i);
- cache.put(key, i);
+ int val = i;
+ doOperation(() -> cache.put(key, val));
}
return null;
@@ -304,6 +307,20 @@ public abstract class GridCacheOffHeapMultiThreadedUpdateAbstractSelfTest extend
return 1_000;
}
+ /** */
+ protected <T> T doOperation(Supplier<T> op) {
+ return op.get();
+ }
+
+ /** */
+ protected void doOperation(Runnable op) {
+ doOperation(() -> {
+ op.run();
+
+ return null;
+ });
+ }
+
/**
*
*/
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientCacheStartFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientCacheStartFailoverTest.java
index 26d94db..28daffe 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientCacheStartFailoverTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientCacheStartFailoverTest.java
@@ -572,8 +572,7 @@ public class IgniteClientCacheStartFailoverTest extends GridCommonAbstractTest {
cache.putAll(map);
}
- //TODO: uncomment TRANSACTIONAL_SNAPSHOT cache creation when IGNITE-9470 will be fixed.
- /* for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < 3; i++) {
CacheConfiguration<Object, Object> ccfg = cacheConfiguration("mvcc-" + i, TRANSACTIONAL_SNAPSHOT, i);
IgniteCache<Object, Object> cache = node.createCache(ccfg);
@@ -581,7 +580,7 @@ public class IgniteClientCacheStartFailoverTest extends GridCommonAbstractTest {
cacheNames.add(ccfg.getName());
cache.putAll(map);
- }*/
+ }
return cacheNames;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMvccTxMultiThreadedAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMvccTxMultiThreadedAbstractTest.java
index bfd80dc..9007050 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMvccTxMultiThreadedAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMvccTxMultiThreadedAbstractTest.java
@@ -25,7 +25,6 @@ import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
import org.jetbrains.annotations.Nullable;
-import org.junit.Ignore;
import org.junit.Test;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
@@ -34,7 +33,6 @@ import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_REA
/**
* Tests for local transactions.
*/
-@Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
public abstract class IgniteMvccTxMultiThreadedAbstractTest extends IgniteTxAbstractTest {
/**
* @return Thread count.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxAbstractTest.java
index 9c33fb9..585b201 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxAbstractTest.java
@@ -47,7 +47,7 @@ import static org.apache.ignite.transactions.TransactionIsolation.SERIALIZABLE;
/**
* Tests for local transactions.
*/
-@SuppressWarnings( {"BusyWait"})
+@SuppressWarnings({"BusyWait"})
abstract class IgniteTxAbstractTest extends GridCommonAbstractTest {
/** Random number generator. */
private static final Random RAND = new Random();
@@ -212,8 +212,8 @@ abstract class IgniteTxAbstractTest extends GridCommonAbstractTest {
throw e;
}
}
- catch (CacheException ex) {
- MvccFeatureChecker.assertMvccWriteConflict(ex);
+ catch (CacheException e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
}
catch (Throwable e) {
log.error("Unexpected error: " + e, e);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
index 3e48da2..8833f95 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
@@ -36,6 +36,7 @@ import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheAdapter;
import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException;
import org.apache.ignite.internal.util.typedef.PA;
+import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.spi.IgniteSpiAdapter;
import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.indexing.IndexingQueryFilter;
@@ -46,7 +47,6 @@ import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionHeuristicException;
import org.apache.ignite.transactions.TransactionIsolation;
-import org.apache.ignite.transactions.TransactionRollbackException;
import org.jetbrains.annotations.Nullable;
import org.junit.Assume;
import org.junit.Test;
@@ -100,6 +100,8 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
+ Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10871", MvccFeatureChecker.forcedMvcc());
+
super.beforeTestsStarted();
lastKey = 0;
@@ -327,8 +329,6 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
*/
private void checkPutTx(boolean putBefore, TransactionConcurrency concurrency,
TransactionIsolation isolation, final Integer... keys) throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10871", MvccFeatureChecker.forcedMvcc());
-
if (MvccFeatureChecker.forcedMvcc() &&
!MvccFeatureChecker.isSupported(concurrency, isolation))
return;
@@ -382,11 +382,9 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
fail("Transaction should fail.");
}
- catch (CacheException e){
- if (!MvccFeatureChecker.forcedMvcc() || !(e.getCause() instanceof TransactionRollbackException))
- throw e;
- }
- catch (TransactionHeuristicException e) {
+ catch (Exception e) {
+ assertTrue("Unexptected exception " + X.getFullStackTrace(e), e instanceof TransactionHeuristicException);
+
log.info("Expected exception: " + e);
}
@@ -491,12 +489,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
return null;
}
- }, CacheException.class, null);
-
- if (MvccFeatureChecker.forcedMvcc())
- assertTrue(err.toString(), err.getCause() instanceof TransactionRollbackException); // Put operation fails.
- else
- assertTrue(err.toString(), err.getCause() instanceof TransactionHeuristicException); // Implicit tx commit fails.
+ }, TransactionHeuristicException.class, null);
checkUnlocked(key);
}
@@ -507,8 +500,6 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
* @throws Exception If failed.
*/
private void checkTransform(boolean putBefore, final Integer key) throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9470", MvccFeatureChecker.forcedMvcc());
-
if (putBefore) {
TestIndexingSpi.forceFail(false);
@@ -586,12 +577,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
return null;
}
- }, CacheException.class, null);
-
- if (MvccFeatureChecker.forcedMvcc())
- assertTrue(err.toString(), err.getCause() instanceof TransactionRollbackException); // Put operation fails.
- else
- assertTrue(err.toString(), err.getCause() instanceof TransactionHeuristicException); // Implicit tx commit fails.
+ }, TransactionHeuristicException.class, null);
for (Integer key : m.keySet())
checkUnlocked(key);
@@ -603,8 +589,6 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
* @throws Exception If failed.
*/
private void checkRemove(boolean putBefore, final Integer key) throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9470", MvccFeatureChecker.forcedMvcc());
-
if (putBefore) {
TestIndexingSpi.forceFail(false);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java
index 829d9dc..ecec29a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java
@@ -32,7 +32,6 @@ import javax.cache.integration.CacheWriterException;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
-import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cache.store.CacheStore;
import org.apache.ignite.cache.store.CacheStoreAdapter;
@@ -51,7 +50,6 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionOptimisticException;
import org.jetbrains.annotations.NotNull;
-import org.junit.Assume;
import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -112,11 +110,6 @@ public class IgniteTxCacheWriteSynchronizationModesMultithreadedTest extends Gri
assertTrue(grid(SRVS + i).configuration().isClientMode());
}
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9470", MvccFeatureChecker.forcedMvcc());
- }
-
/**
* @throws Exception If failed.
*/
@@ -231,7 +224,16 @@ public class IgniteTxCacheWriteSynchronizationModesMultithreadedTest extends Gri
Integer key = rnd.nextInt(MULTITHREADED_TEST_KEYS);
- cache.put(key, rnd.nextInt());
+ while (true) {
+ try {
+ cache.put(key, rnd.nextInt());
+
+ break;
+ }
+ catch (CacheException e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+ }
+ }
}
});
@@ -247,7 +249,16 @@ public class IgniteTxCacheWriteSynchronizationModesMultithreadedTest extends Gri
map.put(key, rnd.nextInt());
}
- cache.putAll(map);
+ while (true) {
+ try {
+ cache.putAll(map);
+
+ break;
+ }
+ catch (CacheException e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+ }
+ }
}
});
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java
index 89d1060..eb3d037 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java
@@ -20,8 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.processors.cache.IgniteTxExceptionAbstractSelfTest;
-import org.junit.Ignore;
-import org.junit.Test;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
@@ -38,60 +36,4 @@ public class GridCacheColocatedTxExceptionSelfTest extends IgniteTxExceptionAbst
@Override protected NearCacheConfiguration nearConfiguration() {
return null;
}
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutAll() throws Exception {
- super.testPutAll();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutBackup() throws Exception {
- super.testPutBackup();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutBackupTx() throws Exception {
- super.testPutBackupTx();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutMultipleKeysTx() throws Exception {
- super.testPutMultipleKeysTx();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutNear() throws Exception {
- super.testPutNear();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutNearTx() throws Exception {
- super.testPutNearTx();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutPrimary() throws Exception {
- super.testPutPrimary();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutPrimaryTx() throws Exception {
- super.testPutPrimaryTx();
- }
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMvccTxMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMvccTxMultiThreadedSelfTest.java
index 022a451..b126720 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMvccTxMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMvccTxMultiThreadedSelfTest.java
@@ -22,7 +22,9 @@ import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.processors.cache.IgniteMvccTxMultiThreadedAbstractTest;
import org.apache.ignite.testframework.MvccFeatureChecker;
+import org.junit.Assume;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -33,7 +35,7 @@ public class GridCachePartitionedMvccTxMultiThreadedSelfTest extends IgniteMvccT
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
if (nearEnabled())
- MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.NEAR_CACHE);
+ Assume.assumeTrue(MvccFeatureChecker.isSupported(MvccFeatureChecker.Feature.NEAR_CACHE));
super.beforeTestsStarted();
}
@@ -44,6 +46,7 @@ public class GridCachePartitionedMvccTxMultiThreadedSelfTest extends IgniteMvccT
CacheConfiguration<?, ?> ccfg = defaultCacheConfiguration();
+ ccfg.setAtomicityMode(TRANSACTIONAL_SNAPSHOT);
ccfg.setCacheMode(PARTITIONED);
ccfg.setBackups(1);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMvccTxMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMvccTxMultiThreadedSelfTest.java
index 2df5d45..87e69df 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMvccTxMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMvccTxMultiThreadedSelfTest.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.cache.distributed.replicated;
+import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.processors.cache.IgniteMvccTxMultiThreadedAbstractTest;
@@ -34,6 +35,7 @@ public class GridCacheReplicatedMvccTxMultiThreadedSelfTest extends IgniteMvccTx
CacheConfiguration ccfg = defaultCacheConfiguration();
+ ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT);
ccfg.setCacheMode(REPLICATED);
ccfg.setEvictionPolicy(null);
@@ -78,4 +80,4 @@ public class GridCacheReplicatedMvccTxMultiThreadedSelfTest extends IgniteMvccTx
@Override protected boolean printMemoryStats() {
return true;
}
-}
\ No newline at end of file
+}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java
index c51d85a..c989822 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java
@@ -20,8 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.replicated;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.processors.cache.IgniteTxExceptionAbstractSelfTest;
-import org.junit.Ignore;
-import org.junit.Test;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -38,60 +36,4 @@ public class GridCacheReplicatedTxExceptionSelfTest extends IgniteTxExceptionAbs
@Override protected NearCacheConfiguration nearConfiguration() {
return null;
}
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutAll() throws Exception {
- super.testPutAll();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutBackup() throws Exception {
- super.testPutBackup();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutBackupTx() throws Exception {
- super.testPutBackupTx();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutMultipleKeysTx() throws Exception {
- super.testPutMultipleKeysTx();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutNear() throws Exception {
- super.testPutNear();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutNearTx() throws Exception {
- super.testPutNearTx();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutPrimary() throws Exception {
- super.testPutPrimary();
- }
-
- /** */
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-10377")
- @Test
- @Override public void testPutPrimaryTx() throws Exception {
- super.testPutPrimaryTx();
- }
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java
index ad19735..8243336 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java
@@ -82,18 +82,15 @@ import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteBiInClosure;
import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.lang.IgniteBiTuple;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionIsolation;
-import org.apache.ignite.transactions.TransactionSerializationException;
import org.jetbrains.annotations.Nullable;
-import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
@@ -107,9 +104,7 @@ import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
/**
- * TODO IGNITE-6739: tests reload
- * TODO IGNITE-6739: extend tests to use single/mutiple nodes, all tx types.
- * TODO IGNITE-6739: test with cache groups.
+ *
*/
@SuppressWarnings("unchecked")
public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
@@ -895,7 +890,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testWaitPreviousTxAck() throws Exception {
testSpi = true;
@@ -912,33 +906,18 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
cache.put(1, 1);
cache.put(2, 1);
- cache.put(3, 1);
tx.commit();
}
TestRecordingCommunicationSpi clientSpi = TestRecordingCommunicationSpi.spi(ignite);
- clientSpi.blockMessages(new IgniteBiPredicate<ClusterNode, Message>() {
- /** */
- boolean block = true;
-
- @Override public boolean apply(ClusterNode node, Message msg) {
- if (block && msg instanceof MvccAckRequestTx) {
- block = false;
-
- return true;
- }
-
- return false;
- }
- });
+ clientSpi.blockMessages((node, msg) -> msg instanceof MvccAckRequestTx);
IgniteInternalFuture<?> txFut1 = GridTestUtils.runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.put(2, 2);
- cache.put(3, 2);
+ cache.put(1, 2);
tx.commit();
}
@@ -950,24 +929,22 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
IgniteInternalFuture<?> txFut2 = GridTestUtils.runAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.put(1, 3);
cache.put(2, 3);
tx.commit();
}
- // Should see changes mady by both tx1 and tx2.
- Map<Object, Object> res = checkAndGetAll(false, cache, F.asSet(1, 2, 3), SCAN, GET);
+ // Should see changes made by both tx1 and tx2.
+ Map<Object, Object> res = checkAndGetAll(false, cache, F.asSet(1, 2), SCAN, GET);
- assertEquals(3, res.get(1));
+ assertEquals(2, res.get(1));
assertEquals(3, res.get(2));
- assertEquals(2, res.get(3));
return null;
}
});
- clientSpi.waitForBlocked();
+ clientSpi.waitForBlocked(2);
Thread.sleep(1000);
@@ -976,11 +953,10 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
txFut1.get();
txFut2.get();
- Map<Object, Object> res = checkAndGetAll(false, cache, F.asSet(1, 2, 3), SCAN, GET);
+ Map<Object, Object> res = checkAndGetAll(false, cache, F.asSet(1, 2), SCAN, GET);
- assertEquals(3, res.get(1));
+ assertEquals(2, res.get(1));
assertEquals(3, res.get(2));
- assertEquals(2, res.get(3));
}
/**
@@ -1212,115 +1188,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
- @Test
- public void testCleanupWaitsForGet2() throws Exception {
- /*
- Simulate case when there are two active transactions modifying the same key
- (it is possible if key lock is released but ack message is delayed), and at this moment
- query is started.
- */
- testSpi = true;
-
- client = false;
-
- startGrids(2);
-
- client = true;
-
- final Ignite client = startGrid(2);
-
- awaitPartitionMapExchange();
-
- final IgniteCache<Object, Object> cache = client.createCache(cacheConfiguration(PARTITIONED, FULL_SYNC, 0, 16).
- setNodeFilter(new TestCacheNodeExcludingFilter(ignite(0).name())));
-
- final Integer key1 = 1;
- final Integer key2 = 2;
-
- try (Transaction tx = client.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.put(key1, 0);
- cache.put(key2, 0);
-
- tx.commit();
- }
-
- TestRecordingCommunicationSpi crdSpi = TestRecordingCommunicationSpi.spi(grid(0));
-
- TestRecordingCommunicationSpi clientSpi = TestRecordingCommunicationSpi.spi(client);
-
- final CountDownLatch getLatch = new CountDownLatch(1);
-
- clientSpi.closure(new IgniteBiInClosure<ClusterNode, Message>() {
- @Override public void apply(ClusterNode node, Message msg) {
- if (msg instanceof MvccAckRequestTx)
- doSleep(2000);
- }
- });
-
- crdSpi.closure(new IgniteBiInClosure<ClusterNode, Message>() {
- /** */
- private AtomicInteger cntr = new AtomicInteger();
-
- @Override public void apply(ClusterNode node, Message msg) {
- if (msg instanceof MvccSnapshotResponse) {
- if (cntr.incrementAndGet() == 2) {
- getLatch.countDown();
-
- doSleep(1000);
- }
- }
- }
- });
-
- final IgniteInternalFuture<?> putFut1 = GridTestUtils.runAsync(new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Transaction tx = client.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.put(key1, 1);
-
- tx.commit();
- }
-
- return null;
- }
- }, "put1");
-
- final IgniteInternalFuture<?> putFut2 = GridTestUtils.runAsync(new Callable<Void>() {
- @Override public Void call() throws Exception {
- try (Transaction tx = client.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.put(key1, 2);
-
- tx.commit();
- }
-
- return null;
- }
- }, "put2");
-
- IgniteInternalFuture<?> getFut = GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
- @Override public Void call() throws Exception {
- U.await(getLatch);
-
- while (!putFut1.isDone() || !putFut2.isDone()) {
- Map<Object, Object> vals1 = checkAndGetAll(false, cache, F.asSet(key1, key2), SCAN);
- Map<Object, Object> vals2 = checkAndGetAll(false, cache, F.asSet(key1, key2), GET);
-
- assertEquals(2, vals1.size());
- assertEquals(2, vals2.size());
- }
-
- return null;
- }
- }, 4, "get-thread");
-
- putFut1.get();
- putFut2.get();
- getFut.get();
- }
-
- /**
- * @throws Exception If failed.
- */
@Test
public void testCleanupWaitsForGet3() throws Exception {
for (int i = 0; i < 4; i++) {
@@ -1740,7 +1607,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testPessimisticTxGetAllReadsSnapshot_SingleNode_SinglePartition() throws Exception {
txReadsSnapshot(1, 0, 0, 1, GET);
@@ -1749,7 +1615,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testPessimisticTxGetAllReadsSnapshot_ClientServer() throws Exception {
txReadsSnapshot(4, 2, 1, 64, GET);
@@ -1758,7 +1623,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testPessimisticTxScanReadsSnapshot_SingleNode_SinglePartition() throws Exception {
txReadsSnapshot(1, 0, 0, 1, SCAN);
@@ -1767,7 +1631,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testPessimisticTxScanReadsSnapshot_ClientServer() throws Exception {
txReadsSnapshot(4, 2, 1, 64, SCAN);
@@ -1863,10 +1726,7 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
tx.commit();
}
catch (CacheException ex) {
- if (ex.getCause() instanceof TransactionSerializationException)
- continue;
-
- throw ex;
+ MvccFeatureChecker.assertMvccWriteConflict(ex);
}
}
finally {
@@ -2216,10 +2076,8 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
tx.commit();
}
catch (Exception e) {
- if (e.getCause() instanceof TransactionSerializationException)
- continue;
-
- Assert.assertTrue("Unexpected error: " + e, X.hasCause(e, ClusterTopologyException.class));
+ if (!X.hasCause(e, ClusterTopologyException.class))
+ MvccFeatureChecker.assertMvccWriteConflict(e);
}
}
finally {
@@ -2901,7 +2759,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testImplicitPartsScan_SingleNode_SinglePartition() throws Exception {
doImplicitPartsScanTest(1, 0, 0, 1, 10_000);
@@ -2910,7 +2767,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testImplicitPartsScan_SingleNode() throws Exception {
doImplicitPartsScanTest(1, 0, 0, 64, 10_000);
@@ -2919,7 +2775,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testImplicitPartsScan_ClientServer_Backups0() throws Exception {
doImplicitPartsScanTest(4, 2, 0, 64, 10_000);
@@ -2928,7 +2783,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testImplicitPartsScan_ClientServer_Backups1() throws Exception {
doImplicitPartsScanTest(4, 2, 1, 64, 10_000);
@@ -2937,7 +2791,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testImplicitPartsScan_ClientServer_Backups2() throws Exception {
doImplicitPartsScanTest(4, 2, 2, 64, 10_000);
@@ -3049,10 +2902,7 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
tx.commit();
}
catch (CacheException ex) {
- if (ex.getCause() instanceof TransactionSerializationException)
- continue;
-
- throw ex;
+ MvccFeatureChecker.assertMvccWriteConflict(ex);
}
finally {
cache.readUnlock();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java
index f5401a0..25ed33b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java
@@ -537,8 +537,6 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
*/
@Test
public void testRollbackDelayNearLockRequest() throws Exception {
- Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-9470", MvccFeatureChecker.forcedMvcc());
-
final Ignite client = startClient();
final Ignite prim = primaryNode(0, CACHE_NAME);
@@ -567,7 +565,7 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
fail();
}
catch (CacheException e) {
- assertTrue(X.getFullStackTrace(e),X.hasCause(e, TransactionRollbackException.class));
+ assertTrue(X.getFullStackTrace(e), X.hasCause(e, TransactionRollbackException.class));
}
rollbackFut.get();
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java b/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java
index b37c049..674c86a 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java
@@ -123,7 +123,6 @@ public class MvccFeatureChecker {
}
/**
- * TODO proper exception handling after https://issues.apache.org/jira/browse/IGNITE-9470
* Checks if given exception was caused by MVCC write conflict.
*
* @param e Exception.
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SqlTransactionsCommandsWithMvccEnabledSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SqlTransactionsCommandsWithMvccEnabledSelfTest.java
index 5253f83..95ed2eb 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SqlTransactionsCommandsWithMvccEnabledSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/SqlTransactionsCommandsWithMvccEnabledSelfTest.java
@@ -128,7 +128,7 @@ public class SqlTransactionsCommandsWithMvccEnabledSelfTest extends AbstractSche
/**
* Test that attempting to perform various SQL operations within non SQL transaction yields an exception.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
+ @Ignore("https://issues.apache.org/jira/browse/IGNITE-11357")
@Test
public void testSqlOperationsWithinNonSqlTransaction() {
assertSqlOperationWithinNonSqlTransactionThrows("COMMIT");
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccPartitionedSqlQueriesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccPartitionedSqlQueriesTest.java
index e0b4a24..6bca3c2 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccPartitionedSqlQueriesTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccPartitionedSqlQueriesTest.java
@@ -24,7 +24,7 @@ import static org.apache.ignite.cache.CacheMode.PARTITIONED;
/** */
public class CacheMvccPartitionedSqlQueriesTest extends CacheMvccSqlQueriesAbstractTest {
/** {@inheritDoc} */
- protected CacheMode cacheMode() {
+ @Override protected CacheMode cacheMode() {
return PARTITIONED;
}
}
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccReplicatedSqlQueriesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccReplicatedSqlQueriesTest.java
index ba8a5c3..3522879 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccReplicatedSqlQueriesTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccReplicatedSqlQueriesTest.java
@@ -24,7 +24,7 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED;
/** */
public class CacheMvccReplicatedSqlQueriesTest extends CacheMvccSqlQueriesAbstractTest {
/** {@inheritDoc} */
- protected CacheMode cacheMode() {
+ @Override protected CacheMode cacheMode() {
return REPLICATED;
}
}
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlQueriesAbstractTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlQueriesAbstractTest.java
index e9937b2..6d89cfb 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlQueriesAbstractTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlQueriesAbstractTest.java
@@ -28,6 +28,7 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicBoolean;
+import javax.cache.CacheException;
import javax.cache.processor.MutableEntry;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
@@ -41,8 +42,8 @@ import org.apache.ignite.internal.util.lang.GridInClosure3;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
-import org.junit.Ignore;
import org.junit.Test;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -53,10 +54,7 @@ import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
/**
- * TODO IGNITE-6739: text/spatial indexes with mvcc.
- * TODO IGNITE-6739: indexingSpi with mvcc.
- * TODO IGNITE-6739: setQueryParallelism with mvcc.
- * TODO IGNITE-6739: dynamic index create.
+ *
*/
@SuppressWarnings("unchecked")
public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractTest {
@@ -137,7 +135,6 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testUpdateSingleValue_SingleNode() throws Exception {
updateSingleValue(true, false);
@@ -146,7 +143,6 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testUpdateSingleValue_LocalQuery_SingleNode() throws Exception {
updateSingleValue(true, true);
@@ -155,7 +151,6 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testUpdateSingleValue_ClientServer() throws Exception {
updateSingleValue(false, false);
@@ -167,8 +162,6 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
* @throws Exception If failed.
*/
private void updateSingleValue(boolean singleNode, final boolean locQry) throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-9470");
-
final int VALS = 100;
final int writers = 4;
@@ -201,30 +194,40 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
try {
Integer key = rnd.nextInt(VALS);
- cache.cache.invoke(key, new CacheEntryProcessor<Integer, MvccTestSqlIndexValue, Object>() {
- @Override public Object process(MutableEntry<Integer, MvccTestSqlIndexValue> e, Object... args) {
- Integer key = e.getKey();
+ while (true) {
+ try {
+ cache.cache.invoke(key, new CacheEntryProcessor<Integer, MvccTestSqlIndexValue, Object>() {
+ @Override public Object process(MutableEntry<Integer, MvccTestSqlIndexValue> e,
+ Object... args) {
+ Integer key = e.getKey();
- MvccTestSqlIndexValue val = e.getValue();
+ MvccTestSqlIndexValue val = e.getValue();
- int newIdxVal;
+ int newIdxVal;
- if (val.idxVal1 < INC_BY) {
- assertEquals(key.intValue(), val.idxVal1);
+ if (val.idxVal1 < INC_BY) {
+ assertEquals(key.intValue(), val.idxVal1);
- newIdxVal = val.idxVal1 + INC_BY;
- }
- else {
- assertEquals(INC_BY + key, val.idxVal1);
+ newIdxVal = val.idxVal1 + INC_BY;
+ }
+ else {
+ assertEquals(INC_BY + key, val.idxVal1);
- newIdxVal = key;
- }
+ newIdxVal = key;
+ }
+
+ e.setValue(new MvccTestSqlIndexValue(newIdxVal));
- e.setValue(new MvccTestSqlIndexValue(newIdxVal));
+ return null;
+ }
+ });
- return null;
+ break;
}
- });
+ catch (CacheException e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+ }
+ }
}
finally {
cache.readUnlock();
@@ -371,7 +374,6 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testJoinTransactional_SingleNode() throws Exception {
joinTransactional(true, false);
@@ -380,7 +382,6 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testJoinTransactional_ClientServer() throws Exception {
joinTransactional(false, false);
@@ -389,7 +390,6 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testJoinTransactional_DistributedJoins_ClientServer() throws Exception {
joinTransactional(false, true);
@@ -401,8 +401,6 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
* @throws Exception If failed.
*/
private void joinTransactional(boolean singleNode, final boolean distributedJoin) throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-9470");
-
final int KEYS = 100;
final int writers = 4;
@@ -422,31 +420,38 @@ public abstract class CacheMvccSqlQueriesAbstractTest extends CacheMvccAbstractT
IgniteTransactions txs = cache.cache.unwrap(Ignite.class).transactions();
try {
- try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
- Integer key = rnd.nextInt(KEYS);
+ while (true) {
+ try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ Integer key = rnd.nextInt(KEYS);
- JoinTestChildKey childKey = new JoinTestChildKey(key);
+ JoinTestChildKey childKey = new JoinTestChildKey(key);
- JoinTestChild child = (JoinTestChild)cache.cache.get(childKey);
+ JoinTestChild child = (JoinTestChild)cache.cache.get(childKey);
- if (child == null) {
- Integer parentKey = distributedJoin ? key + 100 : key;
+ if (child == null) {
+ int parentKey = distributedJoin ? key + 100 : key;
- child = new JoinTestChild(parentKey);
+ child = new JoinTestChild(parentKey);
- cache.cache.put(childKey, child);
+ cache.cache.put(childKey, child);
- JoinTestParent parent = new JoinTestParent(parentKey);
+ JoinTestParent parent = new JoinTestParent(parentKey);
- cache.cache.put(new JoinTestParentKey(parentKey), parent);
- }
- else {
- cache.cache.remove(childKey);
+ cache.cache.put(new JoinTestParentKey(parentKey), parent);
+ }
+ else {
+ cache.cache.remove(childKey);
- cache.cache.remove(new JoinTestParentKey(child.parentId));
- }
+ cache.cache.remove(new JoinTestParentKey(child.parentId));
+ }
- tx.commit();
+ tx.commit();
+
+ break;
+ }
+ catch (CacheException e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+ }
}
cnt++;
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlTxQueriesAbstractTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlTxQueriesAbstractTest.java
index d4b4620..2047d1c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlTxQueriesAbstractTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlTxQueriesAbstractTest.java
@@ -68,7 +68,7 @@ import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionDuplicateKeyException;
-import org.junit.Ignore;
+import org.apache.ignite.transactions.TransactionSerializationException;
import org.junit.Test;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -1219,7 +1219,6 @@ public abstract class CacheMvccSqlTxQueriesAbstractTest extends CacheMvccAbstrac
/**
* @throws Exception If failed.
*/
- @Ignore("https://issues.apache.org/jira/browse/IGNITE-9470")
@Test
public void testQueryInsertUpdateMultithread() throws Exception {
ccfg = cacheConfiguration(cacheMode(), FULL_SYNC, 2, DFLT_PARTITION_COUNT)
@@ -1237,26 +1236,33 @@ public abstract class CacheMvccSqlTxQueriesAbstractTest extends CacheMvccAbstrac
IgniteEx node = grid(0);
try {
- try (Transaction tx = node.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- tx.timeout(TX_TIMEOUT);
+ while (true) {
+ try (Transaction tx = node.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ tx.timeout(TX_TIMEOUT);
- IgniteCache<Object, Object> cache0 = node.cache(DEFAULT_CACHE_NAME);
+ IgniteCache<Object, Object> cache0 = node.cache(DEFAULT_CACHE_NAME);
- SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO Integer (_key, _val) values (1,1),(2,2),(3,3)");
+ SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO Integer (_key, _val) values (1,1),(2,2),(3,3)");
- try (FieldsQueryCursor<List<?>> cur = cache0.query(qry)) {
- cur.getAll();
- }
+ try (FieldsQueryCursor<List<?>> cur = cache0.query(qry)) {
+ cur.getAll();
+ }
- awaitPhase(phaser, 2);
+ awaitPhase(phaser, 2);
- qry = new SqlFieldsQuery("INSERT INTO Integer (_key, _val) values (4,4),(5,5),(6,6)");
+ qry = new SqlFieldsQuery("INSERT INTO Integer (_key, _val) values (4,4),(5,5),(6,6)");
- try (FieldsQueryCursor<List<?>> cur = cache0.query(qry)) {
- cur.getAll();
- }
+ try (FieldsQueryCursor<List<?>> cur = cache0.query(qry)) {
+ cur.getAll();
+ }
- tx.commit();
+ tx.commit();
+
+ break;
+ }
+ catch (CacheException e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+ }
}
}
catch (Exception e) {
@@ -1272,24 +1278,30 @@ public abstract class CacheMvccSqlTxQueriesAbstractTest extends CacheMvccAbstrac
try {
phaser.arriveAndAwaitAdvance();
- try (Transaction tx = node.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- tx.timeout(TX_TIMEOUT);
+ while (true) {
+ try (Transaction tx = node.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ tx.timeout(TX_TIMEOUT);
- IgniteCache<Integer, Integer> cache0 = node.cache(DEFAULT_CACHE_NAME);
+ IgniteCache<Integer, Integer> cache0 = node.cache(DEFAULT_CACHE_NAME);
- cache0.invokeAllAsync(F.asSet(1, 2, 3, 4, 5, 6), new EntryProcessor<Integer, Integer, Void>() {
- @Override
- public Void process(MutableEntry<Integer, Integer> entry,
- Object... arguments) throws EntryProcessorException {
- entry.setValue(entry.getValue() * 10);
+ cache0.invokeAllAsync(F.asSet(1, 2, 3, 4, 5, 6), new EntryProcessor<Integer, Integer, Void>() {
+ @Override public Void process(MutableEntry<Integer, Integer> entry,
+ Object... arguments) throws EntryProcessorException {
+ entry.setValue(entry.getValue() * 10);
- return null;
- }
- });
+ return null;
+ }
+ });
- phaser.arrive();
+ phaser.arrive();
- tx.commit();
+ tx.commit();
+
+ break;
+ }
+ catch (Exception e) {
+ assertTrue(e instanceof TransactionSerializationException);
+ }
}
}
catch (Exception e) {
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/MvccDeadlockDetectionTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/MvccDeadlockDetectionTest.java
index 409e501..ee9470d 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/MvccDeadlockDetectionTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/MvccDeadlockDetectionTest.java
@@ -43,6 +43,7 @@ import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.GridTestUtils.SF;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
+import org.apache.ignite.transactions.TransactionRollbackException;
import org.junit.After;
import org.junit.Test;
@@ -608,8 +609,7 @@ public class MvccDeadlockDetectionTest extends GridCommonAbstractTest {
fut.get(10, TimeUnit.SECONDS);
}
catch (IgniteCheckedException e) {
- // TODO check expected exceptions once https://issues.apache.org/jira/browse/IGNITE-9470 is resolved
- if (X.hasCause(e, IgniteTxRollbackCheckedException.class))
+ if (X.hasCause(e, TransactionRollbackException.class))
aborted++;
else
throw e;
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java
index 18ea78d..c536d79 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java
@@ -58,9 +58,9 @@ import org.apache.ignite.internal.processors.query.GridQueryCancel;
import org.apache.ignite.internal.processors.query.GridQueryProcessor;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiPredicate;
+import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
-import org.apache.ignite.transactions.TransactionSerializationException;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -270,7 +270,8 @@ public class QueryDataPageScanTest extends GridCommonAbstractTest {
tx.commit();
}
catch (CacheException e) {
- assertTrue(e.getCause() instanceof TransactionSerializationException);
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+
if (!e.getMessage().contains(
"Cannot serialize transaction due to write conflict (transaction is marked for rollback)"))
throw new IllegalStateException(e);