GG-13361 Fixing local partition initialization

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

Branch: refs/heads/ignite-7505
Commit: ffc71339e4bccfbe1d5e1202e457951461b4e1cb
Parents: 02bac6a
Author: Alexey Goncharuk <[email protected]>
Authored: Tue Jan 23 14:13:48 2018 +0300
Committer: Alexey Goncharuk <[email protected]>
Committed: Tue Jan 23 14:13:48 2018 +0300

----------------------------------------------------------------------
 .../dht/GridDhtPartitionTopologyImpl.java          | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ffc71339/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index bc0d607..0cfe330 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -359,12 +359,7 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
                     assert exchId.isJoined() || added;
 
                     for (int p = 0; p < num; p++) {
-                        IgnitePageStoreManager storeMgr = ctx.pageStore();
-
-                        if (localNode(p, aff)
-                            || (storeMgr instanceof FilePageStoreManager
-                            && grp.persistenceEnabled()
-                            && 
Files.exists(((FilePageStoreManager)storeMgr).getPath(grp.sharedGroup(), 
grp.cacheOrGroupName(), p)))) {
+                        if (localNode(p, aff) || initLocalPartition(p, 
discoCache)) {
                             GridDhtLocalPartition locPart = createPartition(p);
 
                             if (grp.persistenceEnabled()) {
@@ -430,6 +425,16 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
         updateRebalanceVersion(aff);
     }
 
+    private boolean initLocalPartition(int p, DiscoCache discoCache) {
+        IgnitePageStoreManager storeMgr = ctx.pageStore();
+
+        return
+            discoCache.baselineNode(ctx.localNodeId()) &&
+            storeMgr instanceof FilePageStoreManager &&
+            grp.persistenceEnabled() &&
+            
Files.exists(((FilePageStoreManager)storeMgr).getPath(grp.sharedGroup(), 
grp.cacheOrGroupName(), p));
+    }
+
     /**
      * @param affVer Affinity version.
      * @param aff Affinity assignments.

Reply via email to