scheduler: Revert requireCanary logic #8867
Merged
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.
Revert the
requireCanary
check introduced in https://github.com/hashicorp/nomad/pull/8691/files#diff-1801138ac4d10f2064ba6f2e434ac9b4L430-R431 .The change was intended to fix a case where a canary alloc may fail to
be rescheduled if all the other allocs fail as well (e.g. if all allocs
happen to be placed on a node that died).
However, it introduced some unintended side-effects: if all allocs of a successful deployment fail, the scheduler will place canary allocs unexpectedly if the service has a single alloc that is to be migrated. Services with multiple allocations can be affected if all allocations are to be migrated or lost at once (e.g. all happen to run on a single client that is drained).
I added a test case for the failure, and it's failing in https://app.circleci.com/pipelines/github/hashicorp/nomad/11698/workflows/e90b6ba6-aad3-484d-8042-b1dce5239e50/jobs/99179 but is green ultimately.
Reverting the change for now and will investigate further.
Fixes #8866 .