Repository navigation
scheduler: keep draining batch alloc counted when node is re-enabled - #28018
Conversation
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
tgross
left a comment
There was a problem hiding this comment.
Marking this as "request changes" for now just until we get the details of the bug worked out with you over in #28008 (comment)
tgross
left a comment
There was a problem hiding this comment.
As per our discussion in #28008 (comment) this LGTM.
Can I get you to run make cl to add a user-facing changelog entry? Thanks!
Sure thing! ✅ 🙂 |
a95e42f to
1d203e7
Compare
|
@tgross would you like to see any other changes? |
tgross
left a comment
There was a problem hiding this comment.
LGTM. Thanks @szabolcsgelencser!
…28018) When a node that is currently draining a batch job allocation is re-enabled (set back to eligible) before the allocation has finished stopping, Nomad creates a new replacement allocation for the batch job. This contradicts the documented batch-drain behavior, which says a batch allocation should be allowed to complete on the draining node and should not be replaced. This appears to be a regression / follow-up edge case to the fix shipped in #26961, which corrected the case where a new allocation was created immediately on batch-job drain. That fix works correctly when the drain runs to completion. The bug shows up only in the narrow window where the allocation is still running (i.e. it takes some time to shut down) and the operator toggles the node back to eligible during that window. The evaluation that creates the extra allocation is shown in the UI as triggered by node-update, which lines up with the node going from ineligible back to eligible.
…28018) When a node that is currently draining a batch job allocation is re-enabled (set back to eligible) before the allocation has finished stopping, Nomad creates a new replacement allocation for the batch job. This contradicts the documented batch-drain behavior, which says a batch allocation should be allowed to complete on the draining node and should not be replaced. This appears to be a regression / follow-up edge case to the fix shipped in #26961, which corrected the case where a new allocation was created immediately on batch-job drain. That fix works correctly when the drain runs to completion. The bug shows up only in the narrow window where the allocation is still running (i.e. it takes some time to shut down) and the operator toggles the node back to eligible during that window. The evaluation that creates the extra allocation is shown in the UI as triggered by node-update, which lines up with the node going from ineligible back to eligible.
…s re-enabled (#28018) (#28155) When a node that is currently draining a batch job allocation is re-enabled (set back to eligible) before the allocation has finished stopping, Nomad creates a new replacement allocation for the batch job. This contradicts the documented batch-drain behavior, which says a batch allocation should be allowed to complete on the draining node and should not be replaced. This appears to be a regression / follow-up edge case to the fix shipped in #26961, which corrected the case where a new allocation was created immediately on batch-job drain. That fix works correctly when the drain runs to completion. The bug shows up only in the narrow window where the allocation is still running (i.e. it takes some time to shut down) and the operator toggles the node back to eligible during that window. The evaluation that creates the extra allocation is shown in the UI as triggered by node-update, which lines up with the node going from ineligible back to eligible. Co-authored-by: Szabolcs Gelencsér <74185105+szabolcsgelencser@users.noreply.github.com>
…ashicorp#28018) When a node that is currently draining a batch job allocation is re-enabled (set back to eligible) before the allocation has finished stopping, Nomad creates a new replacement allocation for the batch job. This contradicts the documented batch-drain behavior, which says a batch allocation should be allowed to complete on the draining node and should not be replaced. This appears to be a regression / follow-up edge case to the fix shipped in hashicorp#26961, which corrected the case where a new allocation was created immediately on batch-job drain. That fix works correctly when the drain runs to completion. The bug shows up only in the narrow window where the allocation is still running (i.e. it takes some time to shut down) and the operator toggles the node back to eligible during that window. The evaluation that creates the extra allocation is shown in the UI as triggered by node-update, which lines up with the node going from ineligible back to eligible.
Description
When a node that is currently draining a batch job allocation is re-enabled
(set back to eligible) before the allocation has finished stopping, Nomad
creates a new replacement allocation for the batch job. This contradicts the
documented batch-drain behavior, which says a batch allocation should be
allowed to complete on the draining node and should not be replaced.
This appears to be a regression / follow-up edge case to the fix shipped in
#26961, which corrected the case where a new allocation was created
immediately on batch-job drain. That fix works correctly when the drain runs
to completion. The bug shows up only in the narrow window where the
allocation is still running (i.e. it takes some time to shut down) and the
operator toggles the node back to eligible during that window.
The evaluation that creates the extra allocation is shown in the UI as
triggered by node-update, which lines up with the node going from
ineligible back to eligible.
Testing & Reproduction steps
amount of time (e.g. ~1 minute — a
kill_timeoutlong enough that thealloc remains in
runningfor a while after being asked to stop).runningon some node.allocation is marked for stop but is still
runningon the node (this isthe documented behavior — the batch alloc is allowed to finish).
re-enable the node.
Links
Fixes #28008
Contributor Checklist
changelog entry using the
make clcommand.ensure regressions will be caught.
and job configuration, please update the Nomad product documentation, which is stored in the
web-unified-docsrepo. Refer to theweb-unified-docscontributor guide for docs guidelines.Please also consider whether the change requires notes within the upgrade
guide. If you would like help with the docs, tag the
nomad-docsteam in this PR.Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.