sodonnel commented on code in PR #10084:
URL: https://github.com/apache/ozone/pull/10084#discussion_r3125416436
##########
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 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.
Yea, I think we can live with that. People should not be upgrading clusters
with nodes in strange states IMO, as it just adds to potential problems.
On stale nodes, there are:
stale : unfinalized
stale : finalized
The second we can just count as a finalized node and not worry about it. The
second is a problem.
It can either go to dead and we can ignore it, or it can go back to healthy
and may or may not finalize and go stale again. I guess if it is able to go
stale -> healthy, it should must have heartbeat and hence picked up its
finalize command, but it may not process it if the DN is in bad shape, and it
may not heartbeat again.
I think our upgrade write path design could handle a node that slips through
un-finalized? Or do we put some extra logic in to fence it out until it
finalizes? For a stale node, all its Ratis pipelines get closed on transition
to stale anyway, so it is effectively out of the write path at that point.
--
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]