Repository navigation
HDDS-16182. Extend container balancer start command with auto-config - #11906
sreejasahithi wants to merge 3 commits into
Conversation
|
@ashishkumar50 could you please review this PR. |
|
Thanks @sreejasahithi for the patch.
Can you please re-enable workflows in your fork and push a change to trigger it for this PR? Afterwards you may want to manually disable:
|
There was a problem hiding this comment.
Thanks @sreejasahithi for working on this.
- Currently
startcommand with--auto-configonly prints -
Starting with auto-configured parameters (profile: MEDIUM).
Container Balancer started successfully.
The user can’t see what was actually applied. Could we print the effective parameters (and where each came from: user override, profile or configuration) before starting? The rationale map is already available, or we could reuse the suggested-command builder. That makes a bad override visible and lets users reproduce the run.
Alternatively, print the equivalent ozone admin containerbalancer start ... command that estimate and recommend already build, so the user can copy and re-run it.
The values it started with aren’t shown. As discussed, status -v already prints the configuration the balancer is running with, so that is enough and we don’t need to print them again at start.
It would help to say so where users will look. Could we mention it in the --auto-config option description and/or in the output, for example:
Starting with auto-configured parameters (profile: MEDIUM).
Use "ozone admin containerbalancer status -v" to see the configuration in use.
- Normalize all recommended values to the units
startcommand accepts, in one place. ThenfloorToWholeGb,bytesToGband the/ 60000helpers can be removed.
… to minutes in one place, and added a status --verbose hint to start --auto-config
ashishkumar50
left a comment
There was a problem hiding this comment.
@sreejasahithi Thanks for the patch.
| byteDesc(estimation.getMaxSizeLeavingSource()))); | ||
| rationale.put("maxSizeEnteringTarget", String.format( | ||
| "profile default (%d GB)", estimation.getMaxSizeEnteringTarget() / OzoneConsts.GB)); | ||
| "profile default (%d GB)", maxSizeEnteringTargetGb)); |
There was a problem hiding this comment.
The recommendation calculation supports user-provided overrides, but the rationale still reports configuration/profile defaults?
| ? request.maxSizeToMovePerIteration | ||
| : computeRecommendedMaxSizeToMove(configCeiling, initialEstimation); | ||
| // Normalize to whole GB, the unit accepted by the start command. | ||
| long maxSizeToMoveGb = recommendedMaxMove / OzoneConsts.GB; |
There was a problem hiding this comment.
Ensure the normalized values always satisfy:
- maxSizeToMovePerIteration > 0
- maxSizeEnteringTarget <= maxSizeToMovePerIteration
- maxSizeLeavingSource <= maxSizeToMovePerIteration
What changes were proposed in this pull request?
This PR adds --auto-config (and optional --profile) to ozone admin containerbalancer start. The command reads current datanode usage from SCM, runs the existing container balancer advisor (MEDIUM profile by default), and starts the balancer with the recommended settings. Explicit flags (for example -i, -e, size and timeout options) still apply during recommendation and at start. If the cluster is already balanced, it prints a message and does not start the balancer.
What is the link to the Apache JIRA
HDDS-16182
How was this patch tested?
Unit tests in TestContainerBalancerSubCommand for --auto-config, overrides, --profile validation, and the balanced-cluster no-start path.
Green CI : https://github.com/sreejasahithi/ozone/actions/runs/41023328534