ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/9] ignite git commit: ignite-3479
Date Fri, 22 Sep 2017 14:27:23 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3479 db7534b43 -> 921df28ce


ignite-3479


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

Branch: refs/heads/ignite-3479
Commit: 1d9f2de97134fb44bb50b31f24a1ee17c333affd
Parents: db7534b
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Sep 22 14:36:00 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Sep 22 14:36:00 2017 +0300

----------------------------------------------------------------------
 .../mvcc/CacheCoordinatorsSharedManager.java    | 61 ++++++++++----------
 .../cache/mvcc/CacheMvccTransactionsTest.java   |  6 +-
 2 files changed, 32 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1d9f2de9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
index 893b1f9..07531a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/CacheCoordinatorsSharedManager.java
@@ -549,40 +549,11 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
     private MvccCoordinatorVersionResponse assignQueryCounter(UUID qryNodeId, long futId)
{
         assert crdVer != 0;
 
-        Long mvccCntr;
-
-        for(;;) {
-            mvccCntr = committedCntr.get();
-
-            for (;;) {
-                AtomicInteger qryCnt = activeQueries.get(mvccCntr);
-
-                if (qryCnt != null) {
-                    boolean inc = increment(qryCnt);
-
-                    if (!inc) {
-                        activeQueries.remove(mvccCntr, qryCnt);
-
-                        continue;
-                    }
-                }
-                else {
-                    qryCnt = new AtomicInteger(1);
-
-                    if (activeQueries.putIfAbsent(mvccCntr, qryCnt) != null)
-                        continue;
-                }
-
-                break;
-            }
-
-            if (mvccCntr == committedCntr.get())
-                break;
+        MvccCoordinatorVersionResponse res = new MvccCoordinatorVersionResponse();
 
-            onQueryDone(mvccCntr);
-        }
+        Long mvccCntr;
 
-        MvccCoordinatorVersionResponse res = new MvccCoordinatorVersionResponse();
+        mvccCntr = committedCntr.get();
 
         Long trackCntr = mvccCntr;
 
@@ -593,6 +564,8 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
             res.addTx(txVer);
         }
 
+        registerActiveQuery(trackCntr);
+
         TestDebugLog.addEntryMessage(mvccCntr, res.activeTransactions(), "qry cntr");
 
         res.init(futId, crdVer, mvccCntr, COUNTER_NA);
@@ -600,6 +573,30 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
         return res;
     }
 
+    private void registerActiveQuery(Long cntr) {
+        for (;;) {
+            AtomicInteger qryCnt = activeQueries.get(cntr);
+
+            if (qryCnt != null) {
+                boolean inc = increment(qryCnt);
+
+                if (!inc) {
+                    activeQueries.remove(mvccCntr, qryCnt);
+
+                    continue;
+                }
+            }
+            else {
+                qryCnt = new AtomicInteger(1);
+
+                if (activeQueries.putIfAbsent(cntr, qryCnt) != null)
+                    continue;
+            }
+
+            break;
+        }
+    }
+
     /**
      * @param mvccCntr Query counter.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1d9f2de9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java
----------------------------------------------------------------------
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 035cf8e..13be10d 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
@@ -1163,13 +1163,13 @@ public class CacheMvccTransactionsTest extends GridCommonAbstractTest
{
     )
         throws Exception
     {
-        final int ACCOUNTS = 5;
+        final int ACCOUNTS = 20;
 
         final int ACCOUNT_START_VAL = 1000;
 
-        final int writers = 2;
+        final int writers = 4;
 
-        final int readers = 1;
+        final int readers = 4;
 
         final IgniteInClosure<IgniteCache<Object, Object>> init = new IgniteInClosure<IgniteCache<Object,
Object>>() {
             @Override public void apply(IgniteCache<Object, Object> cache) {


Mime
View raw message