fix: exclude ineligible nodes from pool capacity calculations#1286
Draft
ritesh-harihar wants to merge 2 commits intomainfrom
Draft
fix: exclude ineligible nodes from pool capacity calculations#1286ritesh-harihar wants to merge 2 commits intomainfrom
ritesh-harihar wants to merge 2 commits intomainfrom
Conversation
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.
Description
Root Cause:
FilterNodesWithOptions() used only two conditions on the fast-path filter.
This allowed ready + ineligible nodes to pass through to getPoolResources(), which then summed their allocatable resources into the pool total. Ineligible nodes cannot receive new allocations, so their resources should not be counted as available capacity.
Fix:
Added node.SchedulingEligibility == api.NodeSchedulingEligible to the fast-path condition:
This is a strict check —> nodes with an empty SchedulingEligibility field are also excluded (fail-closed), which is the safe default since such nodes cannot be confirmed as schedulable.
JIRA ISSUE
Testing:
Verified with a local 3-node Nomad cluster (test-setup/gh910). Two of the three ready nodes were marked ineligible.
Without fix: allocatable_memory=110592 — all 3 ready nodes counted, including the 2 ineligible ones.
With fix: allocatable_memory=36864 — only the 1 eligible node
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.