You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/10/09 10:56:39 UTC

[GitHub] [ignite] agoncharuk commented on a change in pull request #6942: IGNITE-9913

agoncharuk commented on a change in pull request #6942: IGNITE-9913
URL: https://github.com/apache/ignite/pull/6942#discussion_r332950512
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeContext.java
 ##########
 @@ -77,6 +95,28 @@ public ExchangeContext(boolean crd, GridDhtPartitionsExchangeFuture fut) {
         evts = new ExchangeDiscoveryEvents(fut);
     }
 
+    /**
+     * @param fut Future.
+     */
+    private boolean localRecoveryNeeded(GridDhtPartitionsExchangeFuture fut) {
+        for (CacheGroupContext grp : fut.sharedContext().cache().cacheGroups()) {
+            if (grp.isLocal())
+                continue;
+
+            GridAffinityAssignmentCache aff = grp.affinity();
+
+            Set<Integer> failedPrimaries = aff.primaryPartitions(fut.exchangeId().eventNode().id(), aff.lastVersion());
+            Set<Integer> locBackups = aff.backupPartitions(fut.sharedContext().localNodeId(), aff.lastVersion());
+
+            for (int part : failedPrimaries) {
+                if (locBackups.contains(part))
+                    return true;
+            }
 
 Review comment:
   This code does not look correct. A node may OWN a partition, but it will not be reported in aff.backupPartitions because the method returns current assignment, not the local partitions state. GridDhtPartitionTopology should be read for this information. A corresponding test need to be added.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services