adwetojha opened a new pull request, #11401: URL: https://github.com/apache/ozone/pull/11401
## What changes were proposed in this pull request? `InnerNodeImpl#getLeaf` used a raw string-prefix comparison to determine whether an excluded scope belonged to a child subtree. As a result, an excluded path under `/r10` was also treated as belonging under `/r1`, reducing both subtrees' available leaf counts and causing `chooseRandom` to return `null` even when an eligible node existed. The change uses `Node#isAncestor(String)` for topology-aware path comparison. This preserves exact-node and genuine-descendant exclusions while respecting path-component boundaries. A regression test creates nodes under `/r1` and `/r10`, excludes the node under `/r10`, and verifies that the node under `/r1` is selected. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16631 ## How was this patch tested? - Focused regression test: `mvn -ntp -pl :hdds-server-framework test '-Dtest=TestNetworkTopologyImpl#testChooseRandomWithExcludedScopePrefix' -DskipShade -DskipRecon -DskipDocs` - Full affected module: `mvn -ntp -pl :hdds-server-framework clean test -DskipShade -DskipRecon -DskipDocs` (`646` tests, `0` failures, `0` errors, `1` skipped) - Checkstyle: `./hadoop-ozone/dev-support/checks/checkstyle.sh` - Fork `build-branch` workflow: https://github.com/adwetojha/ozone/actions/runs/37128788136 -- 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]
