fix(slurm-controller): add HA single-active guard and defer scontrol …#6009
fix(slurm-controller): add HA single-active guard and defer scontrol …#6009andybubu wants to merge 1 commit into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical stability issues in Slurm High Availability (HA) deployments by implementing an active-controller guard and optimizing the reconfiguration lifecycle. By ensuring only the active controller manages infrastructure state and deferring service reloads until necessary, the changes eliminate race conditions, API quota exhaustion, and intermittent socket timeouts during cluster synchronization. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces several robustness improvements to the Slurm controller setup and synchronization scripts. It adds a polling mechanism to wait for slurmdbd to be ready, defers and consolidates scontrol reconfigure calls for configuration and topology updates to prevent socket timeouts, and adds standby-mode detection for HA controllers. However, a critical issue was identified in the is_active_controller function where the string matching for scontrol ping output checks for "controller" instead of "server", which would cause active controllers to falsely identify as standby and skip essential operations. A code suggestion has been provided to resolve this mismatch.
509282d to
c1d991b
Compare
…reconfigure co-authored-by: Wouter de Geus <wouter.x.degeus@gsk.com>
c1d991b to
10c4aa8
Compare
Summary
Fixes controller race conditions in Slurm High Availability (HA) setups and eliminates
slurm_load_ctl_conf error: Socket timed outduring reconfiguration.This PR introduces an HA Single-Active Guard in
slurmsync.py, defersscontrol reconfigurecalls to a single pass, and polls daemon readiness (scontrol ping) with exponential backoff.Key Problems Solved
1. Dual-Active Execution in Slurm HA Setups
In dual-controller setups (
slurmctld-0Primary andslurmctld-1Backup):slurmsync.pyran concurrently on both controllers every minute.instances.start(),delete_instances(),repair.call_rr_api()), leading to API rate-limit errors (429 Quota Exceeded), race conditions in VM lifecycle management, and corrupted repair tracking.2. Double Restarts & Socket Timeouts
cloud.conf) and placement topology (topology.conf) changed in a single sync pass,slurmctldwas restarted twice sequentially, tearing down mid-registration compute nodes.scontrol reconfigureimmediately aftersystemctl restartcausedSocket timed out on send/recv operationon large clusters whileslurmctldinitialized state.Architectural Changes Introduced
util.is_active_controller):Truefor the single controller.scontrol pingto determine if the local instance is Primary Active (-0) or Backup Takeover (-1). ReturnsFalseon Standby.slurmsync.py):cloud.conf/topology.conf).scontrol reconfigure. Standby controllers log standby status and exit cleanly.util.scontrol_reconfigure()call at the end ofslurmsync.py.wait_slurmctld_up()pollsscontrol pingwith exponential backoff before executingscontrol reconfigure.Modified & Added Files
community/.../scripts/util.py: Addedis_active_controller()andwait_slurmctld_up(); updatedscontrol_reconfigure().community/.../scripts/slurmsync.py: Addedis_active_controllerguard insidemain(); deferredscontrol_reconfigure()execution.community/.../scripts/setup.py: Addedcheck_slurmdbd_readyfor slurmdbd readiness check.NOTE: Community submissions can take up to 2 weeks to be reviewed.
Please take the following actions before submitting this pull request.