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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManager.java:
##########
@@ -177,22 +177,25 @@ default DatanodeFinalizationCounts 
getDatanodeFinalizationCounts() {
 
         ComponentVersion dnApparentVersion = dn.getLastKnownApparentVersion();
         ComponentVersion dnSoftwareVersion = dn.getLastKnownSoftwareVersion();
+        boolean softwareVersionMatchesScm = 
HDDSVersion.SOFTWARE_VERSION.equals(dnSoftwareVersion);
 
         int dnApparentVersionInt = dnApparentVersion.serialize();
         minApparentVersion = Math.min(minApparentVersion, 
dnApparentVersionInt);
         maxApparentVersion = Math.max(maxApparentVersion, 
dnApparentVersionInt);
 
-        if (!dnApparentVersion.equals(dnSoftwareVersion)) {
-          // Datanode has not yet finalized
-          LOG.debug("Datanode {} has not yet finalized: apparent version={}, 
software version={}",
-              dn.getHostName(), dnApparentVersion, dnSoftwareVersion);
-        } else {
+        // A datanode is counted as finalized only if it's software and 
apparent versions match each other
+        // and SCM's software version
+        if (softwareVersionMatchesScm && 
dnApparentVersion.equals(dnSoftwareVersion)) {
           finalizedNodes++;
+        } else {
+          LOG.debug("Datanode {} has not yet finalized: apparent version={}, 
software version={}, " +

Review Comment:
   In general no, as the logger does that check internally. The only time we 
should wrap in debugEnabled is if the parameters are expensive to create.



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