ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] anton-vinogradov commented on a change in pull request #6942: IGNITE-9913
Date Thu, 10 Oct 2019 08:14:04 GMT
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message