rpuch commented on code in PR #4785: URL: https://github.com/apache/ignite-3/pull/4785#discussion_r1857044764
########## 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: I prefer leaving it as is (the difference is minor, and a full-blown rerun of tests is not worth it, I think) -- 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