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


##########
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:
   I did wonder if we should let any decommission(ed / ing) and maintenance 
modes finalize if they are healthy (meaning they are still heartbeating). If 
they are heartbeating they should either finalize or stop heartbeating and go 
dead. They can be forced to finalize if they ever transition back to in_service 
but I don't think that needs a re-register so it would be another code path to 
worry about later.



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