devmadhuu commented on code in PR #6360:
URL: https://github.com/apache/ozone/pull/6360#discussion_r1558840887


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconNodeManager.java:
##########
@@ -321,4 +321,27 @@ public long getNodeDBKeyCount() throws IOException {
       return nodeCount;
     }
   }
+
+  /**
+   * Remove an existing node from the NodeDB. Explicit removal from admin user.
+   * First this API call removes the node info from NodeManager memory and
+   * if successful, then remove the node finally from NODES table as well.
+   *
+   * @param datanodeDetails Datanode details.
+   */
+  @Override
+  public void removeNode(DatanodeDetails datanodeDetails) throws 
NodeNotFoundException, IOException {
+    try {

Review Comment:
   1. Recon calls SCM DeadNodeHandler also before calling its 
ownDeadNodeHandler, so container replicas maintained by Recon by datanode gets 
removed. Below code from SCM DeadNodeHandler:
   ```
    if (!nodeManager.getNodeStatus(datanodeDetails).isInMaintenance()) {
           removeContainerReplicas(datanodeDetails);
         }
   ```
   So since this PR will allow removal only for DEAD and DECOMMISSIONED nodes, 
so container replicas would have already removed for DEAD node. For 
DECOMMISSIONED node also , process cleans up container replicas and SCM code do 
that, but Recon doesn't call any of these methods, Recon just maintains states 
using heartbeats.
   
   2. On 2nd point, I removed this call 
`containerSizeCountTask.process(containerManager.getContainers());`. I agree 
that this is wrong to process any containers based on just replica removal and 
this `containerSizeCountTask` doesn't do any meta operations w.r.t Datanode.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to