-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
d1a301e
to
cf20687
Compare
fbb3a09
to
95c2029
Compare
job_gc_threshold = "12h" | ||
eval_gc_threshold = "12h" | ||
deployment_gc_threshold = "12h" | ||
csi_volume_claim_gc_threshold = "12h" |
There was a problem hiding this comment.
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! 😀
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
There was a problem hiding this 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" |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
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.