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

CSI: fix struct copying errors #9239

Merged
merged 4 commits into from
Nov 18, 2020
Merged

CSI: fix struct copying errors #9239

merged 4 commits into from
Nov 18, 2020

Conversation

tgross
Copy link
Member

@tgross tgross commented Oct 30, 2020

Fixes #8949 #9230

The CSIVolume struct "denormalizes" allocations when it's first queried from the state store. The CSIVolumeByID method on the state store copies the volume before denormalizing so that we don't end up with unexpected changes. The copying has some subtle bugs that meant that Allocations (as well as Topologies and MountOptions) were not getting copied when expected.

Also, ensure we never write allocations attached to volumes to the state store during claims.

@tgross tgross marked this pull request as ready for review November 18, 2020 15:11
// denormalize.
for allocID := range v.ReadAllocs {
v.ReadAllocs[allocID] = nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checking assumptions: v.ReadAllocs contain non-nil pointers so we must set them to nil here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct!

@tgross tgross merged commit 71a378e into master Nov 18, 2020
@tgross tgross deleted the b-csi-volume-copy-bugs branch November 18, 2020 15:59
@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 Dec 10, 2022
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.

nomad volume deregister doesn't work without -force
2 participants