Skip to content

Conversation

@Gargi-jais11
Copy link
Contributor

@Gargi-jais11 Gargi-jais11 commented Jul 28, 2025

What changes were proposed in this pull request?

Introduce a new property which will be by default false .
hdds.datanode.disk.balancer.enabled

If this property is enabled false, then it rejects all related requests in SCM and don’t start the service in DN.
Only once enable true, user can use DiskBalancer service.

This will act as a feature flag for DiskBalancer.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-13497

How was this patch tested?

Passed existing tests.
Verified disabled diskBalancer via running docker-cluster locally.

bash-5.1$ ozone admin datanode diskbalancer report
Disk Balancer is not enabled. Please enable the 'hdds.datanode.disk.balancer.enabled' configuration key.
bash-5.1$ ozone admin datanode diskbalancer start -a
Disk Balancer is not enabled. Please enable the 'hdds.datanode.disk.balancer.enabled' configuration key.
bash-5.1$ ozone admin datanode diskbalancer stop -a 
Disk Balancer is not enabled. Please enable the 'hdds.datanode.disk.balancer.enabled' configuration key.
bash-5.1$ ozone admin datanode diskbalancer status 
Disk Balancer is not enabled. Please enable the 'hdds.datanode.disk.balancer.enabled' configuration key.
bash-5.1$ ozone admin datanode diskbalancer update -b 200 -t 10 -a
Disk Balancer is not enabled. Please enable the 'hdds.datanode.disk.balancer.enabled' configuration key.

@Gargi-jais11 Gargi-jais11 marked this pull request as ready for review July 28, 2025 08:57
@errose28
Copy link
Contributor

Why do we need a feature flag for this? It can only be manually invoked by admins, who in most deployments are the same people who have permissions to update the configuration. This differs from features like hsync and snapshots that are authenticated with ACLs, where the admin can set a feature flag to disable something across the whole namespace. In this case the extra permission check is redundant.

@Gargi-jais11
Copy link
Contributor Author

Gargi-jais11 commented Jul 29, 2025

Why do we need a feature flag for this? It can only be manually invoked by admins, who in most deployments are the same people who have permissions to update the configuration. This differs from features like hsync and snapshots that are authenticated with ACLs, where the admin can set a feature flag to disable something across the whole namespace. In this case the extra permission check is redundant.

You are right that this is different from user-facing features controlled by ACLs. The feature flag isn't about who can run the command, but about whether the command should be runnable at all on the cluster at a given time. As discussed with @ChenSammi as we are planning to merge this feature branch so until and unless proper testing is done we don't want diskBalancer command to run. Once it is done this property will be again set to True and then admins can manually use DiskBalancer.
If developers want to use, they can add this flag to ozone-site.xml as true.

@ChenSammi ChenSammi merged commit 3623f03 into apache:HDDS-5713 Aug 4, 2025
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants