Siddhant Sangwan created HDDS-5728:
--------------------------------------

             Summary: ContainerBalancer should use remaining space to calculate 
utilization.
                 Key: HDDS-5728
                 URL: https://issues.apache.org/jira/browse/HDDS-5728
             Project: Apache Ozone
          Issue Type: Sub-task
          Components: SCM
            Reporter: Siddhant Sangwan
            Assignee: Siddhant Sangwan


ContainerBalancer gets a list of datanodes sorted according to their 
utilizations using NodeManager#getMostOrLeastUsedDatanodes.

There are two ways of calculating utilization:
 # {{used space / capacity}}
 # {{(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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to