You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "rpuch (via GitHub)" <gi...@apache.org> on 2024/11/25 11:26:27 UTC
[PR] IGNITE-23768 Prohibit migration from repaired cluster to old one [ignite-3]
rpuch opened a new pull request, #4785:
URL: https://github.com/apache/ignite-3/pull/4785
https://issues.apache.org/jira/browse/IGNITE-23768
--
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-23768 Prohibit migration from repaired cluster to old one [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-23768 Prohibit migration from repaired cluster to old one [ignite-3]
Posted by "rpuch (via GitHub)" <gi...@apache.org>.
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-23768 Prohibit migration from repaired cluster to old one [ignite-3]
Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #4785:
URL: https://github.com/apache/ignite-3/pull/4785#discussion_r1857040078
##########
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:
It will be called extremely rarely (once per cluster repair)
--
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-23768 Prohibit migration from repaired cluster to old one [ignite-3]
Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch merged PR #4785:
URL: https://github.com/apache/ignite-3/pull/4785
--
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org