chihsuan opened a new pull request, #10648: URL: https://github.com/apache/ozone/pull/10648
## What changes were proposed in this pull request? **Problem.** The RackScatter EC placement policy scatters replicas across racks, but inside a rack it picks a datanode uniformly at random with only a binary "has enough space" check. In a heterogeneous rack (e.g. a 100TB and a 400TB datanode), both are equally likely to be chosen, so the smaller node fills up first. **Fix.** Make the intra-rack choice capacity-aware, reusing the power-of-two approach already used by `SCMContainerPlacementCapacity`: pick two distinct candidate nodes in the rack and keep the one with lower space utilization. This biases placement toward emptier nodes without herding every write onto a single node. Whether a node has enough space is still gated by the existing `isValidNode` check; this only changes which valid node is preferred. The specific mechanism (power-of-two vs. weighted selection) is open to reviewer input. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-15093 ## How was this patch tested? - Added `TestSCMContainerPlacementRackScatter#chooseNodeWithinRackPrefersLessUtilized`: a single rack with an emptier and a fuller datanode; over 1000 placements the emptier node is chosen significantly more often. - Existing `TestSCMContainerPlacementRackScatter` suite still passes (100 tests). - `checkstyle.sh` clean on the module. -- 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]
