Skip to content

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
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants