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 2019/01/22 13:19:46 UTC

[ignite] branch master updated: IGNITE-10753: MVCC: Await all queries are done before checking versions are cleaned. This closes #5786.

This is an automated email from the ASF dual-hosted git repository.

gvvinblade 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 dc5ca32  IGNITE-10753: MVCC: Await all queries are done before checking versions are cleaned. This closes #5786.
dc5ca32 is described below

commit dc5ca3299c66c243233f133072c72ff793290c00
Author: rkondakov <ko...@mail.ru>
AuthorDate: Tue Jan 22 16:19:21 2019 +0300

    IGNITE-10753: MVCC: Await all queries are done before checking versions are cleaned. This closes #5786.
---
 .../processors/cache/mvcc/CacheMvccAbstractTest.java       | 13 +++++++++++++
 .../processors/cache/mvcc/CacheMvccTransactionsTest.java   | 14 ++++++--------
 .../mvcc/CacheMvccAbstractSqlCoordinatorFailoverTest.java  |  2 --
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java
index 29eb572..47804cc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java
@@ -1612,6 +1612,8 @@ public abstract class CacheMvccAbstractTest extends GridCommonAbstractTest {
         if (retry) { // Retry on a stable topology with a newer snapshot.
             awaitPartitionMapExchange();
 
+            waitMvccQueriesDone();
+
             runVacuumSync();
 
             checkOldVersions(true);
@@ -1619,6 +1621,17 @@ public abstract class CacheMvccAbstractTest extends GridCommonAbstractTest {
     }
 
     /**
+     * Waits until all active queries are terminated on the Mvcc coordinator.
+     *
+     * @throws Exception If failed.
+     */
+    private void waitMvccQueriesDone() throws Exception {
+        for (Ignite node : G.allGrids()) {
+            checkActiveQueriesCleanup(node);
+        }
+    }
+
+    /**
      * Checks if outdated versions were cleaned after the vacuum process.
      *
      * @param failIfNotCleaned Fail test if not cleaned.
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 9e115be..627aa92 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
@@ -1091,7 +1091,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    @Ignore("https://issues.apache.org/jira/browse/IGNITE-10753")
     @Test
     public void testCleanupWaitsForGet1() throws Exception {
         boolean vals[] = {true, false};
@@ -1130,8 +1129,10 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
 
         awaitPartitionMapExchange();
 
-        final IgniteCache<Object, Object> srvCache =
-            srv.createCache(cacheConfiguration(PARTITIONED, FULL_SYNC, 0, 16));
+        final IgniteCache<Object, Object> clientCache =
+            client.createCache(cacheConfiguration(PARTITIONED, FULL_SYNC, 0, 16));
+
+        final IgniteCache<Object, Object> srvCache = srv.cache(clientCache.getName());
 
         final Integer key1 = 1;
         final Integer key2 = 2;
@@ -1161,19 +1162,17 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
 
         IgniteInternalFuture<?> getFut = GridTestUtils.runAsync(new Callable<Void>() {
             @Override public Void call() throws Exception {
-                IgniteCache<Integer, Integer> cache = client.cache(srvCache.getName());
-
                 Map<Integer, Integer> vals;
 
                 if (inTx) {
                     try (Transaction tx = client.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
-                        vals = checkAndGetAll(false, cache, F.asSet(key1, key2), SCAN, GET);
+                        vals = checkAndGetAll(false, clientCache, F.asSet(key1, key2), SCAN, GET);
 
                         tx.rollback();
                     }
                 }
                 else
-                    vals = checkAndGetAll(false, cache, F.asSet(key1, key2), SCAN, GET);
+                    vals = checkAndGetAll(false, clientCache, F.asSet(key1, key2), SCAN, GET);
 
                 if (putOnStart) {
                     assertEquals(2, vals.size());
@@ -1323,7 +1322,6 @@ public class CacheMvccTransactionsTest extends CacheMvccAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    @Ignore("https://issues.apache.org/jira/browse/IGNITE-10753")
     @Test
     public void testCleanupWaitsForGet3() throws Exception {
         for (int i = 0; i < 4; i++) {
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractSqlCoordinatorFailoverTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractSqlCoordinatorFailoverTest.java
index 2ab9c62..3d7a8d9 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractSqlCoordinatorFailoverTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractSqlCoordinatorFailoverTest.java
@@ -62,7 +62,6 @@ public abstract class CacheMvccAbstractSqlCoordinatorFailoverTest extends CacheM
     /**
      * @throws Exception If failed.
      */
-    @Ignore("https://issues.apache.org/jira/browse/IGNITE-10753")
     @Test
     public void testAccountsTxSql_SingleNode_CoordinatorFails_Persistence() throws Exception {
         persistence = true;
@@ -95,7 +94,6 @@ public abstract class CacheMvccAbstractSqlCoordinatorFailoverTest extends CacheM
     /**
      * @throws Exception If failed.
      */
-    @Ignore("https://issues.apache.org/jira/browse/IGNITE-10753")
     @Test
     public void testPutAllGetAll_ClientServer_Backups0_RestartCoordinator_SqlDml() throws Exception {
         putAllGetAll(RestartMode.RESTART_CRD, 2, 1, 0, DFLT_PARTITION_COUNT,