sodonnel commented on code in PR #10084:
URL: https://github.com/apache/ozone/pull/10084#discussion_r3110514993
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java:
##########
@@ -144,6 +144,19 @@ default int getAllNodeCount() {
return getAllNodes().size();
}
+ /**
+ * Returns the number of datanodes currently marked finalized by SCM layout
version
+ * metadata/software comparison.
+ */
+ default int getNumDatanodesFinalized() {
+ return (int) getAllNodes().stream()
Review Comment:
I think this should be the IN_SERVICE + HEALTHY node, rather than all. I
guess it might be OK iterating all nodes, but there is a chance that there is
some DEAD node that was finalized, and then in the other place where we get the
total datanode count it could make the counts match when they should not. Eg we
have a finalized decommissioned node, and an unfinalized in_service node and
the decommissioned one counts +1 when it should not.
Really what we want to ensure is that all nodes that can finalize, are
finalized. Nodes unable to finalize, by being dead should not block
finalization.
I think a dead node has to be registered when it comes back alive, at least
if the DN process is restarted. If the DN process is just hung for some time
preventing the heart beats, the node can be moved back to IN_SERVICE.
I wonder if such a node should be forced to finalize before it rejoins -
certainly on registration we can make a node finalize. I think this is out of
scope for this PR, but we need to think about it as another change.
--
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]