Skip to content

Backport of scheduler: account for affinity value of zero in score normalization into release/1.10.x #25890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #25800 to be assessed for backporting due to the inclusion of the label backport/1.10.x.

The below text is copied from the body of the original PR.


If there are no affinities on a job, we don't want to count an affinity score of zero in the number of scores we divide the normalized score by. This is how we handle other scoring components like node reschedule penalties on nodes that weren't running the previous allocation.

But we also exclude counting the affinity in the case where we have affinity but the value is zero. In pathological cases, this can result in a node with a no affinity being picked over a node with low affinity, because the denominator is 1 larger. Include zero-value affinities in the count of scores if the job has affinities but the value just happens to be zero.

Fixes: #25621


Overview of commits

@hc-github-team-nomad-core hc-github-team-nomad-core requested review from a team as code owners May 19, 2025 18:10
@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/gh25621-zero-affinity/vertically-hopeful-mosquito branch from 5fc3b37 to c6bb7ea Compare May 19, 2025 18:10
@vercel vercel bot temporarily deployed to Preview – nomad-ui May 19, 2025 18:12 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad May 19, 2025 18:16 Inactive
@tgross tgross merged commit 0d3863e into release/1.10.x May 19, 2025
29 of 31 checks passed
@tgross tgross deleted the backport/gh25621-zero-affinity/vertically-hopeful-mosquito branch May 19, 2025 18:32
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.

2 participants