Skip to content

fix: exclude ineligible nodes from pool capacity calculations#1286

Draft
ritesh-harihar wants to merge 2 commits intomainfrom
fix-allocatable-memory-filter
Draft

fix: exclude ineligible nodes from pool capacity calculations#1286
ritesh-harihar wants to merge 2 commits intomainfrom
fix-allocatable-memory-filter

Conversation

@ritesh-harihar
Copy link
Copy Markdown
Collaborator

@ritesh-harihar ritesh-harihar commented Apr 27, 2026

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

  • Before fix:
Screenshot 2026-04-27 at 8 38 48 PM
Screenshot 2026-04-27 at 7 49 02 PM
Screenshot 2026-04-27 at 7 11 27 PM
  • After fix:
Screenshot 2026-04-27 at 7 52 46 PM
  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

@ritesh-harihar ritesh-harihar self-assigned this Apr 27, 2026
@ritesh-harihar ritesh-harihar linked an issue Apr 27, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allocatable_memory wrong

1 participant