You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/05/14 10:09:00 UTC

[jira] [Updated] (HDDS-15275) DiskBalancer getIdealUsage handles zero capacity incorrectly

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

ASF GitHub Bot updated HDDS-15275:
----------------------------------
    Labels: pull-request-available  (was: )

> 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
>
> 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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org