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

New database plugin API to reload by plugin name #24472

Merged
merged 5 commits into from
Dec 13, 2023

Conversation

tomhjp
Copy link
Contributor

@tomhjp tomhjp commented Dec 11, 2023

This complements the reset connection API, to also be able to restart by plugin instead of just by connection. This is especially helpful for completing plugin upgrades. In a future PR, I plan to support making an internal call to this endpoint from a more generic plugin reload endpoint to support database plugin reloads across multiple database mounts.

I had originally planned to implement cross-mount plugin reloads by killing plugins directly from the plugin catalog. However, that wouldn't give the best possible UX because the plugin catalog only knows what's currently running, not what the next config should be, so it would only be able to kill the existing plugins and not restart them. Then if the new plugin fails to come up, users won't get the error message as soon as they could have if it got started again immediately. By adding the API to the database plugin directly, we can kill and restart the plugin in the same context and return errors immediately.

@tomhjp tomhjp requested a review from a team as a code owner December 11, 2023 16:55
@tomhjp tomhjp added this to the 1.16.0-rc1 milestone Dec 11, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Dec 11, 2023
Copy link

CI Results:
All Go tests succeeded! ✅

Copy link

Build Results:
All builds succeeded! ✅

Copy link
Contributor

@austingebauer austingebauer left a comment

Choose a reason for hiding this comment

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

LGTM! Assuming API docs will come in a follow-up PR.

@tomhjp
Copy link
Contributor Author

tomhjp commented Dec 12, 2023

Assuming API docs will come in a follow-up PR.

Yep definitely! In part, I wanted to make sure people were happy with the direction before committing to writing the docs.

@tomhjp tomhjp requested a review from a team as a code owner December 12, 2023 14:46
@tomhjp
Copy link
Contributor Author

tomhjp commented Dec 12, 2023

Given the reviews so far I decided to tack the API docs onto this PR for completeness. I also added some more details to the response so that a) users get a warning if nothing was reloaded, and b) users get some visibility over exactly what did get reloaded, which otherwise would be hard to verify

@tomhjp tomhjp merged commit dc5c3e8 into main Dec 13, 2023
110 checks passed
@tomhjp tomhjp deleted the vault-21610/db-reload-plugin-api branch December 13, 2023 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants