Cyrill commented on code in PR #7580:
URL: https://github.com/apache/ignite-3/pull/7580#discussion_r2839546320


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GroupUpdateRequestHandler.java:
##########
@@ -357,6 +367,27 @@ private static CompletableFuture<Integer> partitionUpdate(
         });
     }
 
+    private static boolean pendingQueueIsViableForRecovery(AssignmentsQueue 
queue, Set<String> aliveNodesConsistentIds, int replicas) {
+        // Lets assume we have nodes A, B, C, D, E.
+        // C, D, E restart.
+        // Reset timeout triggers.
+        // Node C, D, E get back online to logical topology and create 
pending=[A, B, C, D, E].
+        // Reset proceeds and sees A, B, C, D, E online at its revision.
+        // Then it overwrites existing pending from above with pending=[A]. 
planned=[A,B].
+        // To prevent this scenario we should skip such reset.
+
+        for (Assignments assignments : queue) {
+            if (assignments
+                    .nodes()
+                    .stream()
+                    .map(Assignment::consistentId).anyMatch(name -> 
!aliveNodesConsistentIds.contains(name))

Review Comment:
   noneMatch would be more readable



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to