ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1.5
Date Thu, 24 Dec 2015 06:27:30 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1537 4b69eab2d -> 7403cfcdb


ignite-1.5


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

Branch: refs/heads/ignite-1537
Commit: 7403cfcdb8867d184654c86ad455d18d4b94feb1
Parents: 4b69eab
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Dec 24 09:27:22 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Dec 24 09:27:22 2015 +0300

----------------------------------------------------------------------
 .../GridNearOptimisticTxPrepareFutureAdapter.java     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7403cfcd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
index 553f8cb..fe6180a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFutureAdapter.java
@@ -52,16 +52,18 @@ public abstract class GridNearOptimisticTxPrepareFutureAdapter extends
GridNearT
         // Obtain the topology version to use.
         long threadId = Thread.currentThread().getId();
 
-        AffinityTopologyVersion topVer;
+        AffinityTopologyVersion topVer = null;
 
-        if (tx != null && tx.system()) {
-            topVer = cctx.exchange().readyAffinityVersion();
+        if (tx.system())
+            topVer = tx.topologyVersionSnapshot();
 
-            assert topVer != null && topVer.topologyVersion() > 0 : topVer;
-        }
-        else
+        if (topVer == null)
             topVer = cctx.mvcc().lastExplicitLockTopologyVersion(threadId);
 
+        // If there is another system transaction in progress, use it's topology version
to prevent deadlock.
+        if (topVer == null && tx.system())
+            topVer = cctx.tm().lockedTopologyVersion(threadId, tx);
+
         if (topVer != null) {
             tx.topologyVersion(topVer);
 


Mime
View raw message