Skip to content

Conversation

@pkazmierczak
Copy link
Contributor

@pkazmierczak pkazmierczak commented Nov 4, 2025

CE part of nomad-enterprise PR
https://github.com/hashicorp/nomad-enterprise/pull/3372


In the past, when doing feasibility checks, we'd perform them in one big loop
in the computePlacements method. At the very end of each node check, should
we get a feasible option from the stack, we'd construct an allocation and
append it to plan. On every subsequent iteration of the loop, stack iterators
that needed to take into account accumulative resource usage (at the moment
it's just the QuotaIterator) would look at the plan and judge feasibility
based on it. Although not a perfect solution (the first placement would
always go through even if it violated the quota!), merging
#26953 broke this behavior, because now
feasible nodes are being found before any placements or plan appends happen.
Thus, QuotaIterator would always get a clean slate of resources used and we
would end up with placements that violate limits.

This changeset modifies the behavior of findNodesForTG method in the
scheduler. If there are quotas enabled for the namespace, it creates a dummy
allocation and temporarily appends it to the plan, in order to get accurate
quota checks.

@pkazmierczak pkazmierczak merged commit d3de9dd into main Nov 4, 2025
52 checks passed
@pkazmierczak pkazmierczak deleted the f-system-deployments-ce-3372 branch November 4, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants