anshuksi282-ksolves opened a new pull request, #8869: URL: https://github.com/apache/hadoop/pull/8869
### Description of PR This PR fixes [YARN-11833](https://issues.apache.org/jira/browse/YARN-11833). When using a file-based configuration provider in an RM HA setup, if RM1 stops and removes a queue, RM2 (still STANDBY) keeps that queue in memory in RUNNING state. On failover, `CapacitySchedulerQueueManager#reinitializeQueues` validates the queue hierarchy and fails with: root.b.b1 cannot be deleted from the capacity scheduler configuration, as the queue is not yet in stopped state. Current State : RUNNING which breaks the failover. Currently validation is skipped during failover only for mutable configuration providers. Since `refreshQueues` only works on the active RM, the standby RM can never move its in-memory queues to STOPPED, and the hierarchy has already been validated on the active RM. So this PR skips queue hierarchy validation while the RM is STANDBY, regardless of the configuration provider. This continues the work started in #7775 by @liubin101, which was auto-closed as stale. On the JIRA, a user confirmed hitting the same issue in production and that the patch fixed it. ### How was this patch tested? Added two tests in `TestCapacityScheduler`: - `testQueueHierarchyValidationSkippedOnFailover`: starts an HA-enabled RM in STANDBY with a file-based config, removes a RUNNING queue, and verifies reinitialization succeeds and the queue is removed. - `testQueueHierarchyValidationEnforcedWhenNotFailingOver`: verifies that removing a non-STOPPED queue still fails validation when not failing over. Verified that `testQueueHierarchyValidationSkippedOnFailover` fails with the above exception when the fix is reverted, and passes with the fix. Also ran `TestCapacityScheduler`, `TestQueueStateManager`, `TestCapacitySchedulerConfigValidator`, `TestQueueState` and `TestRMHA`: 76 tests, all pass. ### AI Tooling Contains content generated by Claude (Anthropic). Used to help investigate the issue, draft the fix and tests, and verify them. -- 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]
