[ 
https://issues.apache.org/jira/browse/HDDS-15275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz-wo Sze resolved HDDS-15275.
-------------------------------
    Fix Version/s: 2.2.0
       Resolution: Fixed

The pull request is now merged.  Thanks, [~slfan1989]!

> DiskBalancer getIdealUsage handles zero capacity incorrectly
> ------------------------------------------------------------
>
>                 Key: HDDS-15275
>                 URL: https://issues.apache.org/jira/browse/HDDS-15275
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Shilun Fan
>            Assignee: Shilun Fan
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.2.0
>
>
> DiskBalancerVolumeCalculation#getIdealUsage does not explicitly handle empty 
> volume lists or volume snapshots whose total capacity is zero.
> Current implementation sums the total capacity and effective used bytes, then 
> directly divides:
> {code:java}
> return ((double) totalEffectiveUsed) / totalCapacity; {code}
> If the input volume list is empty, totalCapacity is 0, so the method returns 
> NaN. If all volumes have zero capacity, the method may return NaN or Infinity 
> depending on effective used bytes.
> This is inconsistent with the method Javadoc, which says an 
> IllegalArgumentException is thrown when total capacity is zero.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to