You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by gv...@apache.org on 2018/12/14 11:09:02 UTC
ignite git commit: IGNITE-10464: MVCC: Create "PDS 4" test suite for
MVCC mode. This closes #5627.
Repository: ignite
Updated Branches:
refs/heads/master 7d259d6e7 -> c72331553
IGNITE-10464: MVCC: Create "PDS 4" test suite for MVCC mode. This closes #5627.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c7233155
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c7233155
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c7233155
Branch: refs/heads/master
Commit: c7233155368000cd482cd6f206f4dbecf26fd7ec
Parents: 7d259d6
Author: rkondakov <ko...@mail.ru>
Authored: Fri Dec 14 14:08:55 2018 +0300
Committer: Igor Seliverstov <gv...@gmail.com>
Committed: Fri Dec 14 14:08:55 2018 +0300
----------------------------------------------------------------------
.../ignite/cache/ResetLostPartitionTest.java | 6 +-
.../IgniteClusterActivateDeactivateTest.java | 4 +-
...erActivateDeactivateTestWithPersistence.java | 14 +-
...balanceOnCachesStoppingOrDestroyingTest.java | 14 +-
...gnitePdsRecoveryAfterFileCorruptionTest.java | 3 +
...PdsPageEvictionDuringPartitionClearTest.java | 4 +
.../db/IgnitePdsPartitionPreloadTest.java | 182 +++++++++++++++++++
.../db/IgnitePdsTransactionsHangTest.java | 14 +-
.../testsuites/IgnitePdsMvccTestSuite4.java | 53 ++++++
.../ignite/testsuites/IgnitePdsTestSuite4.java | 48 ++---
10 files changed, 308 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java b/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java
index 75f7264..405e32f 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java
@@ -36,6 +36,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -59,6 +60,9 @@ public class ResetLostPartitionTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
+ if (MvccFeatureChecker.forcedMvcc())
+ fail("https://issues.apache.org/jira/browse/IGNITE-10560");
+
super.beforeTest();
stopAllGrids();
@@ -85,7 +89,7 @@ public class ResetLostPartitionTest extends GridCommonAbstractTest {
storageCfg.getDefaultDataRegionConfiguration()
.setPersistenceEnabled(true)
- .setMaxSize(300L * 1024 * 1024);
+ .setMaxSize(500L * 1024 * 1024);
cfg.setDataStorageConfiguration(storageCfg);
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
index 6701d29..ecdc82b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
@@ -355,7 +355,7 @@ public class IgniteClusterActivateDeactivateTest extends GridCommonAbstractTest
@Test
public void testJoinWhileActivate1_Server() throws Exception {
if (MvccFeatureChecker.forcedMvcc())
- fail("https://issues.apache.org/jira/browse/IGNITE-10583");
+ fail("https://issues.apache.org/jira/browse/IGNITE-10421");
joinWhileActivate1(false, false);
}
@@ -366,7 +366,7 @@ public class IgniteClusterActivateDeactivateTest extends GridCommonAbstractTest
@Test
public void testJoinWhileActivate1_WithCache_Server() throws Exception {
if (MvccFeatureChecker.forcedMvcc())
- fail("https://issues.apache.org/jira/browse/IGNITE-10583");
+ fail("https://issues.apache.org/jira/browse/IGNITE-10421");
joinWhileActivate1(false, true);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTestWithPersistence.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTestWithPersistence.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTestWithPersistence.java
index 292a667..7737bf0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTestWithPersistence.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTestWithPersistence.java
@@ -28,6 +28,7 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -115,9 +116,11 @@ public class IgniteClusterActivateDeactivateTestWithPersistence extends IgniteCl
public void testDeactivateInactiveCluster() throws Exception {
ccfgs = new CacheConfiguration[] {
new CacheConfiguration<>("test_cache_1")
- .setGroupName("test_cache"),
+ .setGroupName("test_cache")
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL),
new CacheConfiguration<>("test_cache_2")
.setGroupName("test_cache")
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
};
Ignite ignite = startGrids(3);
@@ -301,13 +304,15 @@ public class IgniteClusterActivateDeactivateTestWithPersistence extends IgniteCl
srv.cluster().active(true);
- CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
+ CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME)
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
srv.createCache(ccfg);
stopAllGrids();
- ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME + 1);
+ ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME + 1)
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ccfg.setGroupName(DEFAULT_CACHE_NAME);
@@ -340,7 +345,8 @@ public class IgniteClusterActivateDeactivateTestWithPersistence extends IgniteCl
.setBackups(1)
.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC)
.setIndexedTypes(Integer.class, Integer.class)
- .setAffinity(new RendezvousAffinityFunction(false, 64));
+ .setAffinity(new RendezvousAffinityFunction(false, 64))
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
IgniteCache cache = srv.createCache(ccfg);
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java
index eb7a1ab..b218d39 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteDataStreamer;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -52,6 +53,7 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -209,6 +211,7 @@ public class IgniteRebalanceOnCachesStoppingOrDestroyingTest extends GridCommonA
.setGroupName(names.get2())
.setRebalanceBatchSize(REBALANCE_BATCH_SIZE)
.setCacheMode(CacheMode.REPLICATED)
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
).collect(Collectors.toList());
ig.getOrCreateCaches(configs);
@@ -236,7 +239,16 @@ public class IgniteRebalanceOnCachesStoppingOrDestroyingTest extends GridCommonA
for (int i = 0; i < 3_000; i++) {
int idx = ThreadLocalRandom.current().nextInt(3_000);
- cache.put(idx, new byte[1024]);
+ while (true) {
+ try {
+ cache.put(idx, new byte[1024]);
+
+ break;
+ }
+ catch (Exception e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+ }
+ }
}
}
}, 4, "load-thread");
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java
index b769eda..8c083d6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java
@@ -23,6 +23,7 @@ import java.nio.ByteOrder;
import java.util.Collection;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheRebalanceMode;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -82,6 +83,8 @@ public class IgnitePdsRecoveryAfterFileCorruptionTest extends GridCommonAbstract
ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
+ ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+
cfg.setCacheConfiguration(ccfg);
DataStorageConfiguration memCfg = new DataStorageConfiguration()
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
index 5091d98..a83afd1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
@@ -34,6 +34,7 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -91,6 +92,9 @@ public class IgnitePdsPageEvictionDuringPartitionClearTest extends GridCommonAbs
*/
@Test
public void testPageEvictionOnNodeStart() throws Exception {
+ if (MvccFeatureChecker.forcedMvcc())
+ fail("https://issues.apache.org/jira/browse/IGNITE-10421");
+
for (int r = 0; r < 3; r++) {
cleanPersistenceDir();
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPartitionPreloadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPartitionPreloadTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPartitionPreloadTest.java
index fef4d4b..fd5bc9c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPartitionPreloadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPartitionPreloadTest.java
@@ -47,6 +47,7 @@ import org.junit.runners.JUnit4;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
import static org.apache.ignite.cache.CacheMode.LOCAL;
/**
@@ -172,6 +173,22 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testLocalPreloadPartitionClientMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT).setDataRegionName(MEM);
+
+ startGridsMultiThreaded(GRIDS_CNT);
+
+ IgniteEx client = startGrid("client");
+
+ assertNotNull(client.cache(DEFAULT_CACHE_NAME));
+
+ assertFalse(client.cache(DEFAULT_CACHE_NAME).localPreloadPartition(0));
+ assertFalse(grid(0).cache(DEFAULT_CACHE_NAME).localPreloadPartition(0));
+ }
+
+
+ /** */
+ @Test
public void testLocalPreloadPartitionPrimary() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -181,6 +198,15 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testLocalPreloadPartitionPrimaryMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(
+ () -> G.allGrids().stream().filter(PrimaryNodePredicate.INSTANCE).findFirst().get(), PreloadMode.LOCAL);
+ }
+
+ /** */
+ @Test
public void testLocalPreloadPartitionBackup() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -190,6 +216,15 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testLocalPreloadPartitionBackupMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(
+ () -> G.allGrids().stream().filter(BackupNodePredicate.INSTANCE).findFirst().get(), PreloadMode.LOCAL);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionInMemoryRemote() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL).setDataRegionName(MEM);
@@ -211,6 +246,27 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionInMemoryRemoteMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT).setDataRegionName(MEM);
+
+ startGridsMultiThreaded(GRIDS_CNT);
+
+ IgniteEx client = startGrid("client");
+
+ assertNotNull(client.cache(DEFAULT_CACHE_NAME));
+
+ try {
+ client.cache(DEFAULT_CACHE_NAME).preloadPartition(0);
+
+ fail("Exception is expected");
+ }
+ catch (Exception e) {
+ log.error("Expected", e);
+ }
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionInMemoryLocal() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL).setDataRegionName(MEM);
@@ -234,6 +290,29 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionInMemoryLocalMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT).setDataRegionName(MEM);
+
+ startGridsMultiThreaded(GRIDS_CNT);
+
+ int key = 0;
+
+ Ignite prim = primaryNode(key, DEFAULT_CACHE_NAME);
+
+ int part = prim.affinity(DEFAULT_CACHE_NAME).partition(key);
+
+ try {
+ prim.cache(DEFAULT_CACHE_NAME).preloadPartition(part);
+
+ fail("Exception is expected");
+ }
+ catch (Exception e) {
+ log.error("Expected", e);
+ }
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionTransactionalClientSync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -249,6 +328,21 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionTransactionalClientSyncMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(() -> {
+ try {
+ return startGrid(CLIENT_GRID_NAME);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }, PreloadMode.SYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionTransactionalClientAsync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -264,6 +358,21 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionTransactionalClientAsyncMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(() -> {
+ try {
+ return startGrid(CLIENT_GRID_NAME);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }, PreloadMode.ASYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionTransactionalNodeFilteredSync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -272,6 +381,14 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionTransactionalNodeFilteredSyncMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(() -> grid(0), PreloadMode.SYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionTransactionalNodeFilteredAsync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -280,6 +397,14 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionTransactionalNodeFilteredAsyncMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
+
+ preloadPartition(() -> grid(0), PreloadMode.ASYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionTransactionalPrimarySync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -289,6 +414,15 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionTransactionalPrimarySyncMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(
+ () -> G.allGrids().stream().filter(PrimaryNodePredicate.INSTANCE).findFirst().get(), PreloadMode.SYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionTransactionalPrimaryAsync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -298,6 +432,15 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionTransactionalPrimaryAsyncMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(
+ () -> G.allGrids().stream().filter(PrimaryNodePredicate.INSTANCE).findFirst().get(), PreloadMode.ASYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionTransactionalBackupSync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -307,6 +450,15 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionTransactionalBackupSyncMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(
+ () -> G.allGrids().stream().filter(BackupNodePredicate.INSTANCE).findFirst().get(), PreloadMode.SYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionTransactionalBackupAsync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL);
@@ -316,6 +468,15 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadPartitionTransactionalBackupAsyncMvcc() throws Exception {
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT);
+
+ preloadPartition(
+ () -> G.allGrids().stream().filter(BackupNodePredicate.INSTANCE).findFirst().get(), PreloadMode.ASYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadPartitionAtomicClientSync() throws Exception {
cfgFactory = () -> cacheConfiguration(ATOMIC);
@@ -407,6 +568,17 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
/** */
@Test
+ public void testPreloadLocalTransactionalSyncMvcc() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-9530");
+
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT).setCacheMode(LOCAL);
+
+ preloadPartition(
+ () -> G.allGrids().stream().filter(PrimaryNodePredicate.INSTANCE).findFirst().get(), PreloadMode.SYNC);
+ }
+
+ /** */
+ @Test
public void testPreloadLocalTransactionalAsync() throws Exception {
cfgFactory = () -> cacheConfiguration(TRANSACTIONAL).setCacheMode(LOCAL);
@@ -414,6 +586,16 @@ public class IgnitePdsPartitionPreloadTest extends GridCommonAbstractTest {
() -> G.allGrids().stream().filter(PrimaryNodePredicate.INSTANCE).findFirst().get(), PreloadMode.ASYNC);
}
+ /** */
+ public void testPreloadLocalTransactionalAsyncMvcc() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-9530");
+
+ cfgFactory = () -> cacheConfiguration(TRANSACTIONAL_SNAPSHOT).setCacheMode(LOCAL);
+
+ preloadPartition(
+ () -> G.allGrids().stream().filter(PrimaryNodePredicate.INSTANCE).findFirst().get(), PreloadMode.ASYNC);
+ }
+
/**
* @param execNodeFactory Test node factory.
* @param preloadMode Preload mode.
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java
index 72eeb96..ec70261 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java
@@ -43,6 +43,7 @@ import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+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.TransactionIsolation;
@@ -198,10 +199,17 @@ public class IgnitePdsTransactionsHangTest extends GridCommonAbstractTest {
TestEntity entity = TestEntity.newTestEntity(locRandom);
- try (Transaction tx = g.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
- cache.put(randomKey, entity);
+ while (true) {
+ try (Transaction tx = g.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ cache.put(randomKey, entity);
- tx.commit();
+ tx.commit();
+
+ break;
+ }
+ catch (Exception e) {
+ MvccFeatureChecker.assertMvccWriteConflict(e);
+ }
}
operationCnt.increment();
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite4.java
new file mode 100644
index 0000000..bb93385
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsMvccTestSuite4.java
@@ -0,0 +1,53 @@
+/*
+ * 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.testsuites;
+
+import java.util.HashSet;
+import java.util.Set;
+import junit.framework.TestSuite;
+import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsTaskCancelingTest;
+import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsPartitionPreloadTest;
+import org.apache.ignite.internal.processors.cache.persistence.file.FileDownloaderTest;
+
+/**
+ * Mvcc variant of {@link IgnitePdsTestSuite4}.
+ */
+public class IgnitePdsMvccTestSuite4 extends TestSuite {
+ /**
+ * @return Suite.
+ */
+ public static TestSuite suite() {
+ System.setProperty(IgniteSystemProperties.IGNITE_FORCE_MVCC_MODE_IN_TESTS, "true");
+
+ TestSuite suite = new TestSuite("Ignite persistent Store Mvcc Test Suite 4");
+
+ Set<Class> ignoredTests = new HashSet<>();
+
+ // Skip classes that already contains Mvcc tests
+ ignoredTests.add(IgnitePdsPartitionPreloadTest.class);
+
+ // Skip irrelevant test
+ ignoredTests.add(FileDownloaderTest.class);
+ ignoredTests.add(IgnitePdsTaskCancelingTest.class);
+
+ suite.addTest(IgnitePdsTestSuite4.suite(ignoredTests));
+
+ return suite;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c7233155/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java
index c750f10..fc5cf14 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite4.java
@@ -17,7 +17,7 @@
package org.apache.ignite.testsuites;
-import junit.framework.JUnit4TestAdapter;
+import java.util.Collection;
import junit.framework.TestSuite;
import org.apache.ignite.cache.ResetLostPartitionTest;
import org.apache.ignite.internal.processors.cache.IgniteClusterActivateDeactivateTestWithPersistenceAndMemoryReuse;
@@ -31,6 +31,7 @@ import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsPageE
import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsPartitionPreloadTest;
import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsTransactionsHangTest;
import org.apache.ignite.internal.processors.cache.persistence.file.FileDownloaderTest;
+import org.apache.ignite.testframework.GridTestUtils;
/**
*
@@ -40,25 +41,26 @@ public class IgnitePdsTestSuite4 extends TestSuite {
* @return Suite.
*/
public static TestSuite suite() {
- TestSuite suite = new TestSuite("Ignite Persistent Store Test Suite 4");
-
- addRealPageStoreTestsNotForDirectIo(suite);
-
- suite.addTest(new JUnit4TestAdapter(FileDownloaderTest.class));
-
- suite.addTest(new JUnit4TestAdapter(IgnitePdsTaskCancelingTest.class));
-
- suite.addTest(new JUnit4TestAdapter(IgniteClusterActivateDeactivateTestWithPersistenceAndMemoryReuse.class));
-
- suite.addTest(new JUnit4TestAdapter(IgnitePdsPartitionPreloadTest.class));
-
- suite.addTest(new JUnit4TestAdapter(ResetLostPartitionTest.class));
+ return suite(null);
+ }
- suite.addTest(new JUnit4TestAdapter(IgniteRebalanceOnCachesStoppingOrDestroyingTest.class));
+ /**
+ * @param ignoredTests Ignored tests.
+ * @return Suite.
+ */
+ public static TestSuite suite(Collection<Class> ignoredTests) {
+ TestSuite suite = new TestSuite("Ignite Persistent Store Test Suite 4");
- suite.addTest(new JUnit4TestAdapter(CachePageWriteLockUnlockTest.class));
+ addRealPageStoreTestsNotForDirectIo(suite, ignoredTests);
- suite.addTest(new JUnit4TestAdapter(IgnitePdsCacheWalDisabledOnRebalancingTest.class));
+ GridTestUtils.addTestIfNeeded(suite, FileDownloaderTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgnitePdsTaskCancelingTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgniteClusterActivateDeactivateTestWithPersistenceAndMemoryReuse.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgnitePdsPartitionPreloadTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, ResetLostPartitionTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgniteRebalanceOnCachesStoppingOrDestroyingTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, CachePageWriteLockUnlockTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgnitePdsCacheWalDisabledOnRebalancingTest.class, ignoredTests);
return suite;
}
@@ -67,16 +69,16 @@ public class IgnitePdsTestSuite4 extends TestSuite {
* Fills {@code suite} with PDS test subset, which operates with real page store, but requires long time to execute.
*
* @param suite suite to add tests into.
+ * @param ignoredTests Ignored tests.
*/
- private static void addRealPageStoreTestsNotForDirectIo(TestSuite suite) {
- suite.addTest(new JUnit4TestAdapter(IgnitePdsTransactionsHangTest.class));
-
- suite.addTest(new JUnit4TestAdapter(IgnitePdsPageEvictionDuringPartitionClearTest.class));
+ private static void addRealPageStoreTestsNotForDirectIo(TestSuite suite, Collection<Class> ignoredTests) {
+ GridTestUtils.addTestIfNeeded(suite, IgnitePdsTransactionsHangTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgnitePdsPageEvictionDuringPartitionClearTest.class, ignoredTests);
// Rebalancing test
- suite.addTest(new JUnit4TestAdapter(IgnitePdsContinuousRestartTestWithSharedGroupAndIndexes.class));
+ GridTestUtils.addTestIfNeeded(suite, IgnitePdsContinuousRestartTestWithSharedGroupAndIndexes.class, ignoredTests);
// Integrity test.
- suite.addTest(new JUnit4TestAdapter(IgnitePdsRecoveryAfterFileCorruptionTest.class));
+ GridTestUtils.addTestIfNeeded(suite, IgnitePdsRecoveryAfterFileCorruptionTest.class, ignoredTests);
}
}