ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [26/26] ignite git commit: ignite-6149
Date Mon, 18 Sep 2017 08:43:26 GMT
ignite-6149


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

Branch: refs/heads/ignite-6149
Commit: 62dbb11d5d4f9cb2b23f6311f0dd124a5ade00e9
Parents: 9e21683
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Sep 18 11:32:11 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Sep 18 11:32:11 2017 +0300

----------------------------------------------------------------------
 .../cache/mvcc/CacheCoordinatorsSharedManager.java | 17 +++++++++++++----
 .../cache/mvcc/MvccCoordinatorVersionResponse.java | 14 +++++++-------
 2 files changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/62dbb11d/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 0d3029a..b3cf54e 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
@@ -462,7 +462,7 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
      * @param txId Transaction ID.
      * @return Counter.
      */
-    private MvccCoordinatorVersionResponse assignTxCounter(GridCacheVersion txId, long futId)
{
+    private synchronized MvccCoordinatorVersionResponse assignTxCounter(GridCacheVersion
txId, long futId) {
         assert crdVer != 0;
 
         long nextCtr = mvccCntr.incrementAndGet();
@@ -493,11 +493,20 @@ public class CacheCoordinatorsSharedManager<K, V> extends GridCacheSharedManager
      * @param txId Transaction ID.
      */
     private void onTxDone(GridCacheVersion txId) {
-        Long cntr = activeTxs.remove(txId);
+        GridFutureAdapter fut; // TODO IGNITE-3478.
 
-        assert cntr != null;
+        synchronized (this) {
+            Long cntr = activeTxs.remove(txId);
+
+            assert cntr != null;
+
+            committedCntr.setIfGreater(cntr);
 
-        committedCntr.setIfGreater(cntr);
+            fut = waitTxFuts.remove(cntr);
+        }
+
+        if (fut != null)
+            fut.onDone();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/62dbb11d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccCoordinatorVersionResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccCoordinatorVersionResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccCoordinatorVersionResponse.java
index 3ec6c90..9d61a6d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccCoordinatorVersionResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccCoordinatorVersionResponse.java
@@ -26,7 +26,7 @@ import org.apache.ignite.plugin.extensions.communication.MessageReader;
 import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 
 /**
- *
+ * TODO IGNITE-3478: make sure writeTo/readFrom for txs is optimal.
  */
 public class MvccCoordinatorVersionResponse implements MvccCoordinatorMessage, MvccCoordinatorVersion,
MvccLongList {
     /** */
@@ -78,18 +78,18 @@ public class MvccCoordinatorVersionResponse implements MvccCoordinatorMessage,
M
         txs[txsCnt++] = txId;
     }
 
-    @Override
-    public int size() {
+    /** {@inheritDoc} */
+    @Override public int size() {
         return txsCnt;
     }
 
-    @Override
-    public long get(int i) {
+    /** {@inheritDoc} */
+    @Override public long get(int i) {
         return txs[i];
     }
 
-    @Override
-    public boolean contains(long val) {
+    /** {@inheritDoc} */
+    @Override public boolean contains(long val) {
         for (int i = 0; i < txsCnt; i++) {
             if (txs[i] == val)
                 return true;


Mime
View raw message