Shilun Fan created HDDS-15300:
---------------------------------
Summary: Handle zero-capacity volumes in DiskBalancer policy
Key: HDDS-15300
URL: https://issues.apache.org/jira/browse/HDDS-15300
Project: Apache Ozone
Issue Type: Bug
Reporter: Shilun Fan
Assignee: Shilun Fan
DefaultContainerChoosingPolicy may fail with a NullPointerException when the
volume set contains a zero-capacity volume.
The policy creates VolumeFixedUsage objects for all volumes and sorts them by
VolumeFixedUsage#getUtilization. However, VolumeFixedUsage stores utilization
as null when the underlying volume capacity is 0.
Calling getUtilization() then triggers Objects.requireNonNull and throws
NullPointerException.
This can happen before DiskBalancer starts choosing source/destination volumes,
so one unusable zero-capacity volume can prevent the policy from evaluating
otherwise valid volumes.
DiskBalancer should skip zero-capacity volumes before sorting and continue with
the remaining valid volumes. If fewer than two valid volumes remain, the policy
should return no candidate instead of failing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]