luoyuan3471 opened a new pull request, #8896:
URL: https://github.com/apache/hadoop/pull/8896

   ## Problem
   
   - With asynchronous scheduling and multi-node placement enabled,
     `CapacityScheduler.schedule()` copies every node through
     `ClusterNodeTracker.getAllNodes()` just to check whether the cluster is 
empty.
   - Partition-based scheduling does not use this snapshot. Each scheduling pass
     therefore performs an unnecessary O(N) list copy and allocation while 
holding
     the node-tracker read lock.
   
   ## Solution
   
   - Use `ClusterNodeTracker.nodeCount()` for the empty-cluster check in 
multi-node
     placement mode.
   - Obtain the full node snapshot only in single-node placement mode, 
preserving
     its snapshot-based size and randomized traversal.
   - Add regression coverage for empty clusters and multi-node scheduling 
without
     a full node snapshot.
   
   ## Validation
   
   - JDK 17.0.8, Maven Wrapper 3.9.15: reactor compilation passed.
   - `TestCapacitySchedulerAsyncScheduling`: 18 tests, 0 failures, 0 errors,
     0 skipped.
   - With the original production code, the 3 new regression cases produced
     2 expected failures, 0 errors, and 0 skipped.
   - Fresh Surefire XML, `git diff --check`, and `git diff --cached --check`
     verified. Community CI has not completed. No benchmark result is claimed.
   - Contains content generated by Codex.
   
   ```sh
   ./mvnw -B -pl 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager
 -am \
     -Dtest=TestCapacitySchedulerAsyncScheduling 
-Dsurefire.failIfNoSpecifiedTests=false \
     -Dmaven.test.failure.ignore=false -DforkCount=1 -DskipShade test
   ```
   
   ## Related Jira
   
   [YARN-12050](https://issues.apache.org/jira/browse/YARN-12050)
   


-- 
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]

Reply via email to