tkalkirill commented on code in PR #4785:
URL: https://github.com/apache/ignite-3/pull/4785#discussion_r1856839856


##########
modules/system-disaster-recovery/src/main/java/org/apache/ignite/internal/disaster/system/SystemDisasterRecoveryManagerImpl.java:
##########
@@ -452,6 +465,27 @@ public CompletableFuture<Void> migrate(ClusterState 
targetClusterState) {
                 }, restartExecutor);
     }
 
+    private static boolean isDescendantOrSame(ClusterState 
potencialDescendant, ClusterState potentialAncestor) {

Review Comment:
   Do I understand correctly that this method will not be called often?



##########
modules/system-disaster-recovery/src/main/java/org/apache/ignite/internal/disaster/system/SystemDisasterRecoveryManagerImpl.java:
##########
@@ -452,6 +465,27 @@ public CompletableFuture<Void> migrate(ClusterState 
targetClusterState) {
                 }, restartExecutor);
     }
 
+    private static boolean isDescendantOrSame(ClusterState 
potencialDescendant, ClusterState potentialAncestor) {
+        List<UUID> descendantLineage = 
extractClusterIdsLineage(potencialDescendant);
+        List<UUID> ancestorLineage = 
extractClusterIdsLineage(potentialAncestor);
+
+        return descendantLineage.size() >= ancestorLineage.size()
+                && descendantLineage.subList(0, 
ancestorLineage.size()).equals(ancestorLineage);
+    }
+
+    private static List<UUID> extractClusterIdsLineage(ClusterState state) {
+        List<UUID> lineage = new ArrayList<>();

Review Comment:
   ```suggestion
           var lineage = new ArrayList<UUID>();
   ```



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to