[
https://issues.apache.org/jira/browse/HDDS-15362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HDDS-15362:
----------------------------------
Labels: pull-request-available (was: )
> [DiskBalancer] Handle zero-capacity volumes in status report
> ------------------------------------------------------------
>
> Key: HDDS-15362
> URL: https://issues.apache.org/jira/browse/HDDS-15362
> Project: Apache Ozone
> Issue Type: Bug
> Components: Ozone Datanode
> Reporter: Shilun Fan
> Assignee: Shilun Fan
> Priority: Major
> Labels: pull-request-available
>
> DiskBalancer status/report generation may throw a NullPointerException when a
> datanode contains a zero-capacity volume.
> VolumeFixedUsage does not calculate utilization for a volume whose capacity
> is 0:
>
> {code:java}
> this.utilization = usage.getCapacity() > 0
> ? computeUtilization(...)
> : null; {code}
> However, DiskBalancerService.buildVolumeReportProto() builds report entries
> for all volumes and calls:
> {code:java}
> v.getUtilization() {code}
> Since getUtilization() requires a non-null value, a zero-capacity volume
> causes the status/report path to fail with:
> {code:java}
> java.lang.NullPointerException: utilization == null {code}
> HDDS-15300 already handles zero-capacity volumes in the container choosing
> policy, but the report generation path still needs to preserve and safely
> report such volumes.
> The proposed fix is to keep zero-capacity volumes in the report and set their
> utilization to 0.0, instead of calling getUtilization(). This avoids the
> exception while retaining useful volume information in DiskBalancer status
> output.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]