TCL-5951: Reconcile orphaned Slurm node registrations#26
Merged
jhu-svg merged 4 commits intoMay 8, 2026
Merged
Conversation
Add DeleteOrphanedNodes to the sync loop so ghost scontrol entries are cleaned up automatically. When a worker pod terminates without running its PreStop hook (force-delete, OOM, node crash), its Slurm node registration persists forever. This step compares the Slurm node list against current pods and deletes entries with no matching pod. Runs after RefreshNodeCache (cache is fresh) and before syncNodeSet (scale decisions) so the operator doesn't count ghosts when deciding replica count.
DeleteOrphanedNodes previously listed all Slurm nodes from the controller and deleted any without a matching pod in the current NodeSet's pod list. If multiple NodeSets share a controller, this would incorrectly delete other NodeSets' valid nodes. Filter by nodeNamePrefix (nodeset.Name + "-") so only nodes belonging to the reconciling NodeSet are considered for deletion.
Only delete Slurm nodes that match the current NodeSet's exact ordinal naming pattern so prefix-overlapping NodeSets cannot be touched. Co-authored-by: Cursor <cursoragent@cursor.com>
The NodeSet hostname template (e.g. "slinky-") determines the actual
Slurm node names ("slinky-0"), not the NodeSet name ("slurm-worker-slinky").
Use the template prefix so orphan detection works on real clusters.
Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
sagrawal-byte
approved these changes
May 7, 2026
3eb4716
into
jhu/tcl-5951-add-delete-node-interface
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DeleteOrphanedNodestoSlurmControlInterface— lists all Slurm nodes, compares against current pods, deletes entries with no matching podsyncOrphanedSlurmNodesstep in thesync()chain, after cache refresh and beforesyncNodeSet(scale decisions)slinky-) to match nodes, notnodeset.Name— critical fix found during staging E2EContext
Part of TCL-5951 (Slinky operator lifecycle gaps). This is PR 2 of 3, stacked on PR #25:
DeleteNodecapability (must merge first)DeleteNodeto clean up ghosts in the reconciliation loopWhy this matters
On the FA cluster incident (May 2026), 6 ghost entries accumulated after hardware failures. The operator had no fallback when PreStop didn't run — the only
scontrol deletecall was inside the dying pod. Ghost entries cascade into parking spot collisions (Gap 2) and wrong AHC lookups (Gap 3).Test plan
go build ./...passesjhu-test-slurm-slinky-gap-orphaned-node(2-node H100 cluster, staging s2-us-central-8a):slinky-99→ deleted by operator within one reconcileslinky-5,-10,-42) → all deleted in single cycleslinky-0andslinky-1→ never touched across all testsbar-0(different NodeSet) → NOT deletedslurm-worker-slinky-99(doesn't match hostname prefix) → NOT deletedslurm-worker-slinky-extra-0(non-integer suffix) → NOT deletedisNodeFromNodeSetwas usingnodeset.Nameas prefix but real clusters use the hostname template (slinky-). Fixed withnodeNamePrefixForNodeSet()that readsnodeset.Spec.Template.PodSpecWrapper.Hostname.