sodonnel commented on code in PR #10084:
URL: https://github.com/apache/ozone/pull/10084#discussion_r3110465695
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java:
##########
@@ -1153,13 +1154,12 @@ public HddsProtos.UpgradeStatus queryUpgradeStatus()
throws IOException {
try {
getScm().checkAdminAccess(getRemoteUser(), true);
- // Returning a placeholder for now.
- HddsProtos.UpgradeStatus result = HddsProtos.UpgradeStatus.newBuilder()
- .setScmFinalized(true)
- .setNumDatanodesFinalized(10)
- .setNumDatanodesTotal(10)
- .setShouldFinalize(true)
- .build();
+ UpgradeFinalization.Status scmUpgradeStatus =
+ scm.getLayoutVersionManager().getUpgradeState();
+ int totalDatanodes = scm.getScmNodeManager().getAllNodeCount();
Review Comment:
I just realised that nodeManager probably remembers any dead or
decommissioned nodes and they will never finalize. We actually want the count
of all IN_SERVICE and HEALTHY nodes as those are the ones that should finalize
or end up going dead as they are not responding. So I think we need to use this
API:
```
public int getNodeCount(NodeStatus status) {
return countNodes(matching(status));
}
```
Where the NodeStatus is IN_SERVICE + HEALTHY.
--
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]