sarvekshayr commented on code in PR #9514:
URL: https://github.com/apache/ozone/pull/9514#discussion_r2626716157


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/policy/DefaultContainerChoosingPolicy.java:
##########
@@ -74,8 +74,8 @@ public ContainerData chooseContainer(OzoneContainer 
ozoneContainer,
 
     while (itr.hasNext()) {
       ContainerData containerData = itr.next().getContainerData();
-      if (!inProgressContainerIDs.contains(
-          ContainerID.valueOf(containerData.getContainerID())) &&
+      if (containerData.getBytesUsed() != 0 &&

Review Comment:
   There were cases where some containers had negative size due to an unknown 
bug (see [HDDS-10483](https://issues.apache.org/jira/browse/HDDS-10483)). 
   
   It would be better to use `containerData.getBytesUsed() > 0` than 
`containerData.getBytesUsed() != 0`.
   
   ```suggestion
         if (containerData.getBytesUsed() > 0 &&
   ```



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