devmadhuu opened a new pull request, #11322:
URL: https://github.com/apache/ozone/pull/11322
## What changes were proposed in this pull request?
The datanode disk balancer treats all volumes as one pool, so it can move a
container from an SSD volume to a DISK volume. Now that buckets carry a storage
policy, that silently breaks the policy the data was placed for.
This change groups volumes by `StorageType` in
`DefaultContainerChoosingPolicy` and balances each group on its own, so a
container never moves between volumes of different storage types. The existing
selection logic — ideal usage, lower/upper thresholds,
source-is-highest-utilization, destination-walk, commit-on-selection — is
unchanged; it was extracted into a private method and now runs per group.
A storage type with fewer than two usable volumes is skipped rather than
paired across types. The `stopAfterDiskEven` log message was updated, since
"disks are even" is now also reported when every storage type has fewer than
two volumes.
Most of the diff in `DefaultContainerChoosingPolicy` is re-indentation from
the method extraction; the new logic is few lines.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16040
## How was this patch tested?
Three scenarios added to `TestDefaultContainerChoosingPolicy`:
- Mixed SSD and DISK volumes → the chosen pair stays within one storage
type.
- One SSD volume plus two DISK volumes → the lone SSD volume is skipped,
DISK is balanced.
- One volume per storage type → returns null, nothing moves across types.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]