slfan1989 opened a new pull request, #10294: URL: https://github.com/apache/ozone/pull/10294
## What changes were proposed in this pull request? This PR makes DiskBalancer skip zero-capacity volumes during volume candidate selection. `DefaultContainerChoosingPolicy` sorts volumes by `VolumeFixedUsage#getUtilization`. However, `VolumeFixedUsage` stores utilization as `null` when the volume capacity is 0. If such a volume is included in the volume set, sorting can trigger a `NullPointerException` before DiskBalancer chooses source/destination volumes. This change filters out volumes whose capacity is less than or equal to 0 before sorting by utilization. If fewer than two usable volumes remain after filtering, the policy returns no candidate instead of failing. ## What is the link to the Apache JIRA JIRA: HDDS-15300. Handle zero-capacity volumes in DiskBalancer policy. ## How was this patch tested? Add Junit Test CI: https://github.com/slfan1989/ozone/actions/runs/25983890878 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
