New database plugin API to reload by plugin name#24472
Merged
Conversation
|
CI Results: |
|
Build Results: |
austingebauer
approved these changes
Dec 12, 2023
tvoran
approved these changes
Dec 12, 2023
Contributor
Author
Yep definitely! In part, I wanted to make sure people were happy with the direction before committing to writing the docs. |
Contributor
Author
|
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 |
tvoran
approved these changes
Dec 12, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.