Repository: ignite
Updated Branches:
  refs/heads/ignite-5075-pds c6e89cec4 -> bd7fde5a2


ignite-5075


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

Branch: refs/heads/ignite-5075-pds
Commit: bd7fde5a272069931ac79702516f356321391a74
Parents: c6e89ce
Author: sboikov <[email protected]>
Authored: Wed May 24 10:17:22 2017 +0300
Committer: sboikov <[email protected]>
Committed: Wed May 24 10:17:22 2017 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtGetSingleFuture.java | 28 ++++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bd7fde5a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
index 0ad7a19..b9007ba 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetSingleFuture.java
@@ -87,8 +87,8 @@ public final class GridDhtGetSingleFuture<K, V> extends 
GridFutureAdapter<GridCa
     /** Topology version .*/
     private AffinityTopologyVersion topVer;
 
-    /** Retries because ownership changed. */
-    private Collection<Integer> retries;
+    /** Retry because ownership changed. */
+    private Integer retry;
 
     /** Subject ID. */
     private UUID subjId;
@@ -202,10 +202,13 @@ public final class GridDhtGetSingleFuture<K, V> extends 
GridFutureAdapter<GridCa
 
             if (fut != null) {
                 if (!F.isEmpty(fut.invalidPartitions())) {
-                    if (retries == null)
-                        retries = new HashSet<>();
+                    assert fut.invalidPartitions().size() == 1 : 
fut.invalidPartitions();
 
-                    retries.addAll(fut.invalidPartitions());
+                    retry = F.first(fut.invalidPartitions());
+
+                    onDone((GridCacheEntryInfo)null);
+
+                    return;
                 }
 
                 fut.listen(
@@ -240,17 +243,14 @@ public final class GridDhtGetSingleFuture<K, V> extends 
GridFutureAdapter<GridCa
      *
      */
     private void map0() {
-        // Assign keys to primary nodes.
-        int part = cctx.affinity().partition(key);
+        assert retry == null : retry;
 
-        if (retries == null || !retries.contains(part)) {
-            if (!map(key)) {
-                retries = Collections.singleton(part);
+        if (!map(key)) {
+            retry = cctx.affinity().partition(key);
 
-                onDone((GridCacheEntryInfo)null);
+            onDone((GridCacheEntryInfo)null);
 
-                return;
-            }
+            return;
         }
 
         getAsync();
@@ -258,7 +258,7 @@ public final class GridDhtGetSingleFuture<K, V> extends 
GridFutureAdapter<GridCa
 
     /** {@inheritDoc} */
     @Override public Collection<Integer> invalidPartitions() {
-        return retries == null ? Collections.<Integer>emptyList() : retries;
+        return retry == null ? Collections.<Integer>emptyList() : 
Collections.singletonList(retry);
     }
 
     /**

Reply via email to