valepakh commented on code in PR #5255:
URL: https://github.com/apache/ignite-3/pull/5255#discussion_r1979571459
##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterInitializer.java:
##########
@@ -184,6 +188,20 @@ public CompletableFuture<Void> initCluster(
}
}
+ /**
+ * Validates physical topology before initialization for duplicate
consistent ids. Throws {@link InternalInitException} if such
+ * duplicate is found.
+ */
+ private void validateTopology() {
+ Set<String> consistentIds = new HashSet<>();
+ clusterService.topologyService().allMembers().forEach(node -> {
+ if (!consistentIds.add(node.name())) {
+ LOG.error("Initialization failed, node \"{}\" has duplicate in
the physical topology", node.name());
+ throw new InternalInitException(format("Duplicate consistent
id \"{}\"", node.name()), true);
Review Comment:
Changed to `node name` everywhere
##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterInitializer.java:
##########
@@ -124,6 +126,8 @@ public CompletableFuture<Void> initCluster(
}
try {
+ validateTopology();
Review Comment:
Combined topology snapshot creation and validation. Used this snapshot in
node resolver.
##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterManagementGroupManager.java:
##########
@@ -631,6 +638,11 @@ private void handleCancelInit(CancelInitMessage msg) {
this.scheduledExecutor.execute(this::destroyCmgWithEvents);
}
+ private void handleCancelJoin(CancelJoinMessage msg) {
+ LOG.info("CMG initialization cancelled [reason={}]", msg.reason());
Review Comment:
Fixed
--
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]