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

 ##########
 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:
   Copying answer from issue.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to