You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/07/03 12:36:40 UTC

[09/38] incubator-ignite git commit: IGNITE-621 - Retries.

IGNITE-621 - Retries.


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

Branch: refs/heads/ignite-gg-10239
Commit: c94c0c475b8d8ac5c31302235d0de36f791fc3a0
Parents: 5505b4d
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Sun Jun 21 22:40:01 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Sun Jun 21 22:40:01 2015 -0700

----------------------------------------------------------------------
 .../dht/atomic/GridNearAtomicUpdateFuture.java   | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c94c0c47/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 53150cc..536eb40 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
@@ -338,19 +338,21 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
             cctx.mvcc().removeAtomicFuture(version());
 
         Collection<Object> remapKeys = new ArrayList<>(failed.size());
-        Collection<Object> remapVals = new ArrayList<>(failed.size());
+        Collection<Object> remapVals = vals != null ? new ArrayList<>(failed.size()) : null;
 
         Iterator<?> keyIt = keys.iterator();
-        Iterator<?> valsIt = vals.iterator();
+        Iterator<?> valsIt = vals != null ? vals.iterator() : null;
 
         for (Object key : failed) {
             while (keyIt.hasNext()) {
                 Object nextKey = keyIt.next();
-                Object nextVal = valsIt.next();
+                Object nextVal = valsIt != null ? valsIt.next() : null;
 
                 if (F.eq(key, nextKey)) {
                     remapKeys.add(nextKey);
-                    remapVals.add(nextVal);
+
+                    if (remapVals != null)
+                        remapVals.add(nextVal);
 
                     break;
                 }
@@ -388,8 +390,13 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
         if (op == TRANSFORM && retval == null)
             retval = Collections.emptyMap();
 
-        if (err != null && X.hasCause(err, CachePartialUpdateCheckedException.class) && remapCnt.decrementAndGet() > 0) {
-            remap(X.cause(err, CachePartialUpdateCheckedException.class).failedKeys());
+        if (err != null && X.hasCause(err, CachePartialUpdateCheckedException.class) &&
+            X.hasCause(err, ClusterTopologyCheckedException.class) &&
+            remapCnt.decrementAndGet() > 0) {
+
+            CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
+
+            remap(cause.failedKeys());
 
             return false;
         }