Skip to content
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

Backport of CSI: track node claim before staging to prevent interleaved unstage into release/1.7.x #20610

Merged

Conversation

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

Backport

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

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


The CSI hook for each allocation that claims a volume runs concurrently. If a call to MountVolume happens at the same time as a call to UnmountVolume for the same volume, it's possible for the second alloc to detect the volume has already been staged, then for the original alloc to unpublish and unstage it, only for the second alloc to then attempt to publish a volume that's been unstaged.

The usage tracker on the volume manager was intended to prevent this behavior but the call to claim the volume was made only after staging and publishing was complete. Move the call to claim the volume for the usage tracker to the top of the MountVolume workflow to prevent it from being unstaged until all consuming allocations have called UnmountVolume.

Fixes: #20424


Note this PR currently contains everything in #20532 because they'd otherwise conflict. Once that's been merged I'll rebase on main and take this out of draft. The actual changes are in c01986b Done


Overview of commits

@tgross tgross merged commit f308c54 into release/1.7.x May 16, 2024
19 of 20 checks passed
@tgross tgross deleted the backport/csi-staging-concurrency/suitably-live-imp branch May 16, 2024 14:03
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