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


##########
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 do think we should heartbeat to all nodes we can reach that they should 
finalize. We don't need to count all those nodes towards the HDDS finalization 
exit criteria, but maybe we should. It is simpler to reason that all live nodes 
have finalized, and we don't need to worry about decom/maintenance at all. I 
was considering a scenario where a decom node has just been shut down and might 
block finalization for the full heartbeat timeout, but that is only 10 minutes.
   
   Along the same lines, I'm wondering if we should also count stale nodes 
towards the total count and wait for them to either finalize or go dead. If we 
exclude them from the count, we cannot say that all registered nodes have 
finalized because stale nodes will not have to re-register when they heartbeat 
again. If we include them, there could be one or a few slow nodes that 
periodically go stale and are also not processing the commands which would hold 
up OM.
   
   Mostly I think we just need to make a decision on what states we count and 
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]


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

Reply via email to