Skip to content

HDDS-15093. Make RackScatter intra-rack placement capacity-aware#10648

Open
chihsuan wants to merge 1 commit into
apache:masterfrom
chihsuan:worktree-HDDS-15093
Open

HDDS-15093. Make RackScatter intra-rack placement capacity-aware#10648
chihsuan wants to merge 1 commit into
apache:masterfrom
chihsuan:worktree-HDDS-15093

Conversation

@chihsuan

@chihsuan chihsuan commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

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.

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.

@chihsuan chihsuan changed the title HDDS-15093. Consider node capacity for RackScatter intra-rack placement HDDS-15093. Make RackScatter intra-rack placement capacity-aware Jul 1, 2026
@chihsuan chihsuan marked this pull request as ready for review July 1, 2026 14:58
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.

1 participant