siddhantsangwan opened a new pull request, #3604: URL: https://github.com/apache/ozone/pull/3604
## What changes were proposed in this pull request? In some cases, balancer displays size of data moved as 0GB even after scheduling some moves and successfully completing an iteration. Check the [Jira](https://issues.apache.org/jira/browse/HDDS-6976) for one such example. This happens even though containers have actually been moved, implying that the problem is in calculating the size. The cause could be division of two long values causing a truncation of the fractional part in `ContainerBalancer#moveContainer()`: ``` metrics.incrementDataSizeMovedGBInLatestIteration( containerInfo.getUsedBytes() / OzoneConsts.GB); ``` If container sizes are less than a GB, the result would be 0. This PR sets this metric at the end of the iteration instead of incrementing it after every move. Result is logged as a double value. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-6976 ## How was this patch tested? Existing UTs. -- 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]
