slfan1989 opened a new pull request, #10355:
URL: https://github.com/apache/ozone/pull/10355

   ## What changes were proposed in this pull request?
   
   This pull request fixes a possible `NullPointerException` in the 
DiskBalancer status/report generation path when a datanode contains a 
zero-capacity volume.
   
   `VolumeFixedUsage` does not calculate utilization for a volume whose 
capacity is 0, leaving its utilization value as `null`. However, 
`DiskBalancerService.buildVolumeReportProto()` previously attempted to retrieve 
utilization for every volume while constructing status report entries. As a 
result, a zero-capacity volume could cause DiskBalancer status reporting to 
fail with `NullPointerException: utilization == null`.
   
   This change keeps zero-capacity volumes in the generated report and reports 
their utilization as 0.0. Normal volumes continue to use their calculated 
utilization values. This allows status/report requests to complete successfully 
while preserving useful information about zero-capacity volumes.
   
   A regression unit test is added to verify that a zero-capacity volume can be 
included in the volume report with utilization set to 0.0.
   
   ## What is the link to the Apache JIRA
   
   HDDS-15362. [DiskBalancer] Handle zero-capacity volumes in status report.
   
   ## How was this patch tested?
   
   Added a unit test.
   
   CI: https://github.com/slfan1989/ozone/actions/runs/26357147502


-- 
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]

Reply via email to