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: reap unused volume claims at leadership transitions #11776

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

tgross
Copy link
Member

@tgross tgross commented Jan 4, 2022

When volumewatcher.Watcher starts on the leader, it starts a watch
on every volume and triggers a reap of unused claims on any change to
that volume. But if a reaping is in-flight during leadership
transitions, it will fail and the event that triggered the reap will
be dropped. Perform one reap of unused claims at the start of the
watcher so that leadership transitions don't drop this event.

This bug contributes to #10927 but is not the full cause of all cases.

When `volumewatcher.Watcher` starts on the leader, it starts a watch
on every volume and triggers a reap of unused claims on any change to
that volume. But if a reaping is in-flight during leadership
transitions, it will fail and the event that triggered the reap will
be dropped. Perform one reap of unused claims at the start of the
watcher so that leadership transitions don't drop this event.
@tgross tgross force-pushed the b-csi-reap-on-leader-transition branch from b9d44f5 to aff7296 Compare January 4, 2022 21:20
@vercel vercel bot temporarily deployed to Preview – nomad January 4, 2022 21:20 Inactive
@tgross tgross requested a review from jazzyfresh January 4, 2022 21:20
@tgross tgross self-assigned this Jan 4, 2022
@tgross tgross added this to the 1.2.4 milestone Jan 4, 2022
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

Minor comment about the test func name but not a blocker and absolutely LGTM!

nomad/volumewatcher/volumes_watcher_test.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview – nomad January 5, 2022 15:28 Inactive
@tgross tgross merged commit 0ff0fa1 into main Jan 5, 2022
@tgross tgross deleted the b-csi-reap-on-leader-transition branch January 5, 2022 16:40
@tgross
Copy link
Member Author

tgross commented Jan 28, 2022

This was released in 1.2.4 but I missed backporting it to 1.1.x and 1.0.x. I'll backport it as part of 1.2.5.

tgross added a commit that referenced this pull request Jan 28, 2022
When `volumewatcher.Watcher` starts on the leader, it starts a watch
on every volume and triggers a reap of unused claims on any change to
that volume. But if a reaping is in-flight during leadership
transitions, it will fail and the event that triggered the reap will
be dropped. Perform one reap of unused claims at the start of the
watcher so that leadership transitions don't drop this event.
tgross added a commit that referenced this pull request Jan 28, 2022
When `volumewatcher.Watcher` starts on the leader, it starts a watch
on every volume and triggers a reap of unused claims on any change to
that volume. But if a reaping is in-flight during leadership
transitions, it will fail and the event that triggered the reap will
be dropped. Perform one reap of unused claims at the start of the
watcher so that leadership transitions don't drop this event.
@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 Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants