-
Notifications
You must be signed in to change notification settings - Fork 2k
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 CSI plugins #7878
Conversation
There's a test flake that's been popping up in |
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.
LGTM
// UpsertCSIPlugin writes the plugin to the state store. Note: there | ||
// is currently no raft message for this, as it's intended to support | ||
// testing use cases. | ||
func (s *StateStore) UpsertCSIPlugin(index uint64, plug *structs.CSIPlugin) error { |
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.
🎉
req.Region = c.srv.Region() | ||
err := c.srv.RPC("CSIPlugin.Delete", req, &structs.CSIPluginDeleteResponse{}) | ||
if err != nil { | ||
if err.Error() == "plugin in use" { |
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.
It's a shame to do this with string matching, but I can't think of anything else reasonably easy.
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.
Now that we're on golang 1.14, it'd be worth making sure all our error strings have proper error types so we can test them with errors.Is()
. But for now this will do I guess. 😁
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. |
For the plugin half of #7825
This changeset implements a periodic garbage collection of unused CSI plugins. Plugins are self-cleaning when the last allocation for a plugin is stopped, but this feature will cover any missing edge cases and ensure that upgrades from 0.11.0 and 0.11.1 get any stray plugins cleaned up.
Best reviewed commit-by-commit. 71ad02d includes the addition of a
UpsertCSIPlugin
method on the state store which is primarily to support testing (the normal way plugins get updated is through node updates); we could probably refactor some of our other tests to use this as well.