Backport of DHV: fix unmet claims handling for terminal allocations into release/1.11.x#27627
Merged
tgross merged 1 commit intorelease/1.11.xfrom Mar 4, 2026
Conversation
tgross
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport
This PR is auto-generated from #27613 to be assessed for backporting due to the inclusion of the label backport/1.11.x.
The below text is copied from the body of the original PR.
When we feasibility check dynamic host volume claims for "sticky" volumes, we need to ensure that new allocations are preferentially places on nodes that the job has previously been on. In #27470 we fixed a bug where we were incorrectly handling proposed allocations for the eval, but this fix missed handling of terminal allocations. If an allocation is terminal (server or client), we don't want to count it among the allocations that match a claim, so that we free the claim up for allocations that are replacing it.
Add a check for terminal allocations in the feasibility check. Extract this check out to a function so that it can be tested, and add tests.
While debugging this issue, I discovered that the claims upsert read existing claims out of a read transaction in the middle of the write transaction. This makes it possible for the read to see a stale version that doesn't include any changes from the current write (because
go-memdbdoes not permit dirty reads). Correct this, and extract the claims upsert logic to a method we can test.Improve logging and assertions for the E2E test to make this bug easier to understand as well.
Ref: #27470
Ref: https://hashicorp.atlassian.net/browse/NMD-1267
Contributor Checklist
changelog entry using the
make clcommand.ensure regressions will be caught.
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.
Overview of commits