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

Periodic GC for volume claims #7881

Merged
merged 5 commits into from
May 11, 2020
Merged

Periodic GC for volume claims #7881

merged 5 commits into from
May 11, 2020

Conversation

tgross
Copy link
Member

@tgross tgross commented May 6, 2020

Finishes #7825, similar to #7878

This changeset implements a periodic garbage collection of CSI volumes with missing allocations. This can happen in a scenario where a node update fails partially and the allocation updates are written to raft but the evaluations to GC the volumes are dropped. This feature will cover this edge case and ensure that upgrades from 0.11.0 and 0.11.1 get any stray claims cleaned up.

I've tried to mirror the #7878 PR as much as possible here; best reviewed commit-by-commit as well.

@tgross tgross force-pushed the csi_periodic_claim_gc branch 2 times, most recently from d1a301e to cf20687 Compare May 7, 2020 19:35
@tgross tgross marked this pull request as ready for review May 7, 2020 20:13
@tgross tgross requested a review from langmartin May 7, 2020 20:13
job_gc_threshold = "12h"
eval_gc_threshold = "12h"
deployment_gc_threshold = "12h"
csi_volume_claim_gc_threshold = "12h"
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only new line. Curse you golang diffs! 😀

Copy link
Contributor

Choose a reason for hiding this comment

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

but bless you github option to temporarily hide whitespace diffs

JobGCInterval: "3m",
JobGCThreshold: "12h",
DeploymentGCThreshold: "12h",
CSIVolumeClaimGCThreshold: "12h",
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only new line. Thanks gofmt

@tgross tgross requested a review from jazzyfresh May 8, 2020 12:08
Copy link
Contributor

@langmartin langmartin left a comment

Choose a reason for hiding this comment

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

I think this looks good!

job_gc_threshold = "12h"
eval_gc_threshold = "12h"
deployment_gc_threshold = "12h"
csi_volume_claim_gc_threshold = "12h"
Copy link
Contributor

Choose a reason for hiding this comment

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

but bless you github option to temporarily hide whitespace diffs

vol := i.(*structs.CSIVolume)

// Ignore new volumes
if vol.CreateIndex > oldThreshold {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the result of testing, or just a good idea? It seems like a pretty good idea either way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Inspired by the way we do it for job GC.

@tgross tgross merged commit 8192aa6 into master May 11, 2020
@tgross tgross deleted the csi_periodic_claim_gc branch May 11, 2020 12:20
@github-actions
Copy link

github-actions bot commented Jan 6, 2023

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 Jan 6, 2023
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.

None yet

2 participants