Shilun Fan created HDDS-15628:
---------------------------------

             Summary: [DiskBalancer] Preserve report output order for datanodes 
with the same density
                 Key: HDDS-15628
                 URL: https://issues.apache.org/jira/browse/HDDS-15628
             Project: Apache Ozone
          Issue Type: Sub-task
            Reporter: Shilun Fan
            Assignee: Shilun Fan


DiskBalancer report command sorts datanodes by currentVolumeDensitySum in 
descending order. However, when multiple datanodes have the same 
currentVolumeDensitySum, the output order may not be stable.

The current implementation builds the report list from a ConcurrentHashMap 
values collection before sorting. ConcurrentHashMap does not preserve insertion 
order, so datanodes with equal density may be displayed in an order different 
from the user-provided datanode order.

For example, if the user runs the report command with:

  ozone admin datanode diskbalancer report host-2 host-1

and both host-2 and host-1 have the same currentVolumeDensitySum, the output 
may show host-1 before host-2.

The report output should remain deterministic and preserve the user input order 
when density values are equal. This makes the CLI behavior easier to understand 
and avoids unnecessary output instability.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to