HDDS-14662. Container Balancer does not validate include/exclude datanode names#9812
Open
sravani-revuri wants to merge 7 commits intoapache:masterfrom
Open
HDDS-14662. Container Balancer does not validate include/exclude datanode names#9812sravani-revuri wants to merge 7 commits intoapache:masterfrom
sravani-revuri wants to merge 7 commits intoapache:masterfrom
Conversation
sarvekshayr
reviewed
Feb 24, 2026
Contributor
sarvekshayr
left a comment
There was a problem hiding this comment.
Thanks for identifying and fixing this issue @sravani-revuri. Please add a test to verify the same.
sarvekshayr
reviewed
Feb 24, 2026
...m/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancerTask.java
Outdated
Show resolved
Hide resolved
Contributor
Gargi-jais11
left a comment
There was a problem hiding this comment.
Please find the inlined comments. Rest all looks good to me.
...erver-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancer.java
Outdated
Show resolved
Hide resolved
...m/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancerTask.java
Show resolved
Hide resolved
Contributor
sreejasahithi
left a comment
There was a problem hiding this comment.
Thanks @sravani-revuri for working on this, overall LGTM
just left few minor comments.
...erver-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancer.java
Show resolved
Hide resolved
...m/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancerTask.java
Outdated
Show resolved
Hide resolved
Contributor
sreejasahithi
left a comment
There was a problem hiding this comment.
Thanks @sravani-revuri for updating.
...m/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancerTask.java
Outdated
Show resolved
Hide resolved
sreejasahithi
approved these changes
Feb 26, 2026
Contributor
sreejasahithi
left a comment
There was a problem hiding this comment.
Thanks @sravani-revuri
LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
The ozone admin containerbalancer start command accepts invalid datanode names in -- include-datanodes- and --exclude-datanodes and reports success instead of failing with a validation error. This differs from other admin commands that validate hostnames and fail on invalid input.
Proposed Fix
Add validation for -- include-datanodes and -- exclude-datanodes before starting the balancer.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14662
How was this patch tested?
manual testing done.
Incorrect value given for include node:
Incorrect value given for exclude node:
Correct values given for exclude node:
Correct values given for include node: