hevinhsu commented on code in PR #10598:
URL: https://github.com/apache/ozone/pull/10598#discussion_r3523060374
##########
hadoop-ozone/mini-cluster/src/main/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java:
##########
@@ -527,6 +533,12 @@ public MiniOzoneCluster build() throws IOException {
cluster.startHddsDatanodes();
}
+ // Recreate the Ratis pipeline to prevent imbalanced node placement
across racks
+ // caused by asynchronous DN registration.
+ if (racks != null && startDataNodes) {
+ resetPipelinesForRackAwareness(cluster);
+ }
Review Comment:
> Does this affect the current tests?
It only affects the new rack-awareness test introduced in this PR.
Without recreating the pipelines after all DNs have registered, the initial
RATIS pipelines may be created while only a subset of DNs have reported their
heartbeats. Since pipeline placement is decided at creation time, this can
result in pipelines being placed entirely within a single rack, causing
`assertPipelinesSpanMultipleRacks()` to fail nondeterministically depending on
the DN registration order.
Recreating the pipelines after all DNs are available ensures that placement
is evaluated with the complete cluster topology and makes the test
deterministic.
--
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]