ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [15/34] incubator-ignite git commit: # ignite-1.3.3-p3 init missed retryReadyFuture, do not retry tryPutIfAbsent, backported fixes from master
Date Fri, 21 Aug 2015 08:13:21 GMT
# ignite-1.3.3-p3 init missed retryReadyFuture, do not retry tryPutIfAbsent, backported fixes
from master


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

Branch: refs/heads/master
Commit: c04fceac8f2db6b024b285b537dd26171b95610a
Parents: 8f1c1c0
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Aug 20 09:18:44 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Aug 20 09:55:40 2015 +0300

----------------------------------------------------------------------
 .../dht/atomic/GridNearAtomicUpdateFuture.java          | 12 +++++++++++-
 .../near/GridNearOptimisticTxPrepareFuture.java         |  6 +++++-
 .../near/GridNearPessimisticTxPrepareFuture.java        |  2 ++
 .../processors/cache/transactions/IgniteTxManager.java  |  5 ++---
 4 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c04fceac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 5dc5494..54857e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -231,6 +231,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
 
         nearEnabled = CU.isNearEnabled(cctx);
 
+        if (!waitTopFut)
+            remapCnt = 1;
+
         this.remapCnt = new AtomicInteger(remapCnt);
     }
 
@@ -340,6 +343,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion
topVer) {
         if (waitForPartitionExchange() && topologyVersion().compareTo(topVer) <
0) {
+            GridFutureAdapter<Void> fut = null;
+
             synchronized (this) {
                 if (this.topVer == AffinityTopologyVersion.ZERO)
                     return null;
@@ -348,9 +353,14 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
                     if (topCompleteFut == null)
                         topCompleteFut = new GridFutureAdapter<>();
 
-                    return topCompleteFut;
+                    fut = topCompleteFut;
                 }
             }
+
+            if (fut != null && isDone())
+                fut.onDone();
+
+            return fut;
         }
 
         return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c04fceac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index 4bb4c67..305840b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -567,8 +567,12 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd
             try {
                 cctx.io().send(n, req, tx.ioPolicy());
             }
+            catch (ClusterTopologyCheckedException e) {
+                e.retryReadyFuture(cctx.nextAffinityReadyFuture(tx.topologyVersion()));
+
+                fut.onResult(e);
+            }
             catch (IgniteCheckedException e) {
-                // Fail the whole thing.
                 fut.onResult(e);
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c04fceac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
index 3d43797..a522b62 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
@@ -229,6 +229,8 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
                     cctx.io().send(node, req, tx.ioPolicy());
                 }
                 catch (ClusterTopologyCheckedException e) {
+                    e.retryReadyFuture(cctx.nextAffinityReadyFuture(topVer));
+
                     fut.onNodeLeft(e);
                 }
                 catch (IgniteCheckedException e) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c04fceac/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index b6c77f6..868d1f9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -527,10 +527,9 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
                 TransactionState state = tx.state();
                 AffinityTopologyVersion txTopVer = tx.topologyVersion();
 
-                if ((state == PREPARING || state == PREPARED || state == COMMITTING)
-                    && txTopVer.compareTo(AffinityTopologyVersion.ZERO) > 0 &&
txTopVer.compareTo(topVer) < 0) {
+                if ((state != ACTIVE && state != COMMITTED && state != ROLLED_BACK
&& state != UNKNOWN)
+                    && txTopVer.compareTo(AffinityTopologyVersion.ZERO) > 0 &&
txTopVer.compareTo(topVer) < 0)
                     res.add(tx.finishFuture());
-                }
             }
         }
 


Mime
View raw message