HDDS-16174. Add container balancer assessment command to report cluster imbalance - #11256
sravani-revuri wants to merge 3 commits into
Conversation
|
@ashishkumar50 , @sreejasahithi could you please review these changes? |
sreejasahithi
left a comment
There was a problem hiding this comment.
Thanks @sravani-revuri for the PR,
left few comments
| return; | ||
| } | ||
| builder.append(System.lineSeparator()) | ||
| .append(aboveMean ? "Top " + nodeLimit + ":" : "Bottom " + nodeLimit + ":") |
There was a problem hiding this comment.
The header always uses nodeLimit (default 5), even when fewer nodes are listed (your output shows "Top 5:" with 3 rows). Use the actual list size when list size is < limit
There was a problem hiding this comment.
The command applies -t or config default, but the printed report never shows it. For better understanding, add something like:
Threshold: 10.0%
Optionally Upper limit / Lower limit (values already exist on the snapshot)
Without this, users cannot verify why nodes were classified as source/target without doing mental math.
There was a problem hiding this comment.
we can also add a --json option.
| if (nodes.isEmpty()) { | ||
| return; |
There was a problem hiding this comment.
When there are no over- or under-utilized datanodes (Datanodes above threshold: 0 / Datanodes below threshold: 0), the command still prints the "Source Nodes" and "Target Nodes" section headers, but no node list appears underneath only a blank line before the next section.
That is correct behaviour, but it can look like output was cut off. Consider adding an explicit line such as (none) when the count is 0, so users can tell the command finished successfully and simply found no matching nodes.
What changes were proposed in this pull request?
Provide a one-liner summary of the changes in the PR Title field above.
It should be in the form of
HDDS-1234. Short summary of the change.Please describe your PR in detail:
he users need a way to understand cluster imbalance before starting the balancer — without changing anything or getting config suggestions. The assessment command answers: how imbalanced is the cluster, which datanodes are over/under utilized, and roughly how much data would need to move.
Add ozone admin containerbalancer assessment command which fetches datanode usage info via the existing getDatanodeUsageInfo RPC, runs the cluster analysis from HDDS-16173
and shows a human-readable report. It should provide a simple category label (e.g. large cluster, high imbalance, medium movement ratio) can be derived in the CLI from the returned summary from analyzer.
Output example:
Threshold defaults to 10% from config, with an optional --threshold override. Include/exclude datanode lists should also be supported. limit option (-n) is provided to show top(n) source and target nodes in display (defaults to 5 / min number of nodes in cluster)
Assessment does not show iteration counts, duration estimates, recommended config, or container move details. Those belong to other commands.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16174
How was this patch tested?
Written Unit test and manual testing.
Normal command :
Comparing with datanode usage command:
include and exclude:
node limit: