Repository: ignite
Updated Branches:
  refs/heads/ignite-force-keys [created] 326a5a106


Fixed race in GridDhtForceKeysRequest processing


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

Branch: refs/heads/ignite-force-keys
Commit: 5e39c09ded89a860e50e294a729905d15eafd4ed
Parents: 8616889
Author: Valentin Kulichenko <valentin.kuliche...@gmail.com>
Authored: Fri Oct 2 17:06:45 2015 -0700
Committer: Valentin Kulichenko <valentin.kuliche...@gmail.com>
Committed: Fri Oct 2 17:06:45 2015 -0700

----------------------------------------------------------------------
 .../dht/preloader/GridDhtPreloader.java           | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5e39c09d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 19b461e..74237f8 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -42,6 +42,7 @@ import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffini
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffinityAssignmentResponse;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAssignmentFetchFuture;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
 import org.apache.ignite.internal.util.GridAtomicLong;
@@ -379,10 +380,13 @@ public class GridDhtPreloader extends 
GridCachePreloaderAdapter {
                 GridDhtLocalPartition locPart = top.localPartition(p, 
AffinityTopologyVersion.NONE, false);
 
                 // If this node is no longer an owner.
-                if (locPart == null && !top.owners(p).contains(loc))
+                if (locPart == null && !top.owners(p).contains(loc)) {
                     res.addMissed(k);
 
-                GridCacheEntryEx entry;
+                    continue;
+                }
+
+                GridCacheEntryEx entry = null;
 
                 if (cctx.isSwapOrOffheapEnabled()) {
                     while (true) {
@@ -397,6 +401,14 @@ public class GridDhtPreloader extends 
GridCachePreloaderAdapter {
                             if (log.isDebugEnabled())
                                 log.debug("Got removed entry: " + k);
                         }
+                        catch (GridDhtInvalidPartitionException ignore) {
+                            if (log.isDebugEnabled())
+                                log.debug("Local node is no longer an owner: " 
+ p);
+
+                            res.addMissed(k);
+
+                            break;
+                        }
                     }
                 }
                 else
@@ -625,4 +637,4 @@ public class GridDhtPreloader extends 
GridCachePreloaderAdapter {
          */
         protected abstract void onMessage(ClusterNode node, M msg);
     }
-}
\ No newline at end of file
+}

Reply via email to