sodonnel commented on code in PR #10084:
URL: https://github.com/apache/ozone/pull/10084#discussion_r3136912571


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizer.java:
##########
@@ -177,4 +146,76 @@ private void 
waitForDatanodesToFinalize(SCMUpgradeFinalizationContext context)
       }
     }
   }
+
+  public static DatanodeFinalizationCounts getNumFinalizedDatanodes(
+      NodeManager nodeManager) {
+    int finalizedNodes = 0;
+    int totalHealthyNodes = 0;
+    int unfinalizedNodes = 0;
+
+    for (DatanodeDetails dn : nodeManager.getAllNodes()) {
+      try {
+        // Only check HEALTHY nodes. STALE/DEAD nodes will be told to
+        // finalize when they recover.
+        if (!nodeManager.getNodeStatus(dn).isHealthy()) {

Review Comment:
   We discussed the stale node problem in a meeting yesterday. We have decided 
to just ignore them for now, and allow finalization to complete with only 
healthy nodes. The reasons being:
   
   1. When a node goes stale, its write pipelines are closed and hence it 
cannot be involved in writes anyway.
   2. The data write design for ZDU will handle DNs are different versions, so 
even if this nodes goes back to healthy, the write pipelines will handle it if 
it is unfinalized.
   3. If it goes back to healthy and its actually healthy, then it will be 
given a finalize command over the heartbeat and it will quickly be finalized 
anyway. If its in bad shape, then it may not process the command and will 
likely end up stale again anyway.
   
   Attempting to wait for all state nodes to go dead or return to healthy would 
slow down or block ZDU and it doesn't seem like that is necessary.
   
   So the code as it stands is good, but it would be good to add a comment 
summarizing the reason we are ignoring stale DNs.



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