sashapolo commented on code in PR #795:
URL: https://github.com/apache/ignite-3/pull/795#discussion_r878859465


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/CmgRaftGroupListener.java:
##########
@@ -73,15 +81,42 @@ public void onWrite(Iterator<CommandClosure<WriteCommand>> 
iterator) {
 
             if (command instanceof WriteStateCommand) {
                 storage.putClusterState(((WriteStateCommand) 
command).clusterState());
+
+                clo.result(null);
             } else if (command instanceof JoinRequestCommand) {
-                // TODO: perform validation 
https://issues.apache.org/jira/browse/IGNITE-16717
+                Serializable response = 
validationTokenManager.validateNode((JoinRequestCommand) command);
+
+                clo.result(response);
             } else if (command instanceof JoinReadyCommand) {
-                storage.putLogicalTopologyNode(((JoinReadyCommand) 
command).node());
+                Serializable response = 
validationTokenManager.completeValidation((JoinReadyCommand) command);
+
+                // Non-null response means that the node has not passed the 
validation step.
+                if (response == null) {
+                    addNodeToLogicalTopology((JoinReadyCommand) command);
+                }
+
+                clo.result(response);
             } else if (command instanceof NodesLeaveCommand) {
-                storage.removeLogicalTopologyNodes(((NodesLeaveCommand) 
command).nodes());
+                removeNodesFromLogicalTopology((NodesLeaveCommand) command);
+
+                clo.result(null);
             }
+        }
+    }
+
+    private void addNodeToLogicalTopology(JoinReadyCommand command) {
+        storage.putLogicalTopologyNode(command.node());
+
+        log.info("Node {} has been added to the logical topology", 
command.node().name());

Review Comment:
   > Here and in other places (CmgRaftService, ClusterInitializer, etc) log -> 
LOG
   
   Again, why?



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