greenwich opened a new pull request, #12144:
URL: https://github.com/apache/ozone/pull/12144
## What changes were proposed in this pull request?
When an EC container needs more replicas than there are racks (for example
rs-10-4 = 14 or rs-6-3 = 9 replicas on 8 racks),
`SCMContainerPlacementRackScatter` always puts the extra replicas on the same
racks, in the same order, for every container.
`chooseDatanodesInternal` picks datanodes in two passes:
1. One datanode per rack. The rack list comes from `getAllRacks()`, which
shuffles it.
2. Only when datanodes are still missing: fill racks that already have a
replica, up to `maxReplicasPerRack`.
As a result:
- **Rack skew:** the same racks always get the extra replicas. With rs-6-3
on 8 racks, one rack holds two replicas of every new container, and losing that
rack always costs two indexes.
- **Fixed indexes:** `ECPipelineProvider#create` assigns replica indexes
1..n in the order the policy returns the datanodes. Indexes 1–8 are random, but
index 9 onwards always land on the same racks.
### Change
Copy the used racks into a list, shuffle it once, and use it in both places
the second pass adds used racks. The filtering by `sortRackWithExcludedNodes`,
which puts racks without a replica first during repairs, is unchanged.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17910
## How was this patch tested?
New test
`TestSCMContainerPlacementRackScatter#chooseExtraNodesFromRandomRacksWhenMoreNodesThanRacks`
--
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]