siddhantsangwan opened a new pull request #2625:
URL: https://github.com/apache/ozone/pull/2625


   ## What changes were proposed in this pull request?
   
   ContainerBalancer gets a list of datanodes sorted according to their 
utilizations using `NodeManager#getMostOrLeastUsedDatanodes`.
   
   There are two ways of calculating utilization:
   1.  ```used space / capacity```
   2.  ```(capacity - remaining) / capacity```
   
   `Used` space is obtained using the DU or DF command (`SpaceUsageSource`), 
while `remaining` can either be `capacity - used` or calculated using the 
`java.io.File#getUsableSpace` method. This means the two ways of calculating 
utilization might give different results (when `used` is not equal to `capacity 
- remaining`).
   
   Currently, `NodeManager#getMostOrLeastUsed` uses method 2 while balancer 
uses method 1.
   Instead, both should consistently use the same approach. We prefer method 2 
since the `remaining` space calculation will also account for space used by 
processes other than Ozone. See the documentation in `VolumeInfo` for further 
details on calculating `remaining` space.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5728
   
   ## How was this patch tested?
   
   Existing UT `TestContainerBalancer`
   


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