-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Saved object migrations to allow pre-migration state collection #34996
Comments
Pinging @elastic/kibana-operations |
We should be really careful in enabling something like this. The problem with asynchronous migrations is that Kibana is completely unavailable while migrations run, so if even one plugin performs a slow asynchronous migration that doesn't scale, it could cause significant downtime for Kibana. This could also make it pretty trivial to clobber the underlying ES cluster by slamming it with queries. If we support something like this, which I'm not convinced we should even bother, then we might want to introduce some sort of pre-flight async migration hook that would execute once per plugin per version and then result would be passed to all of the synchronous migration functions, and then something like graph could query for its workspaces in bulk and then return a map of names to ids that its own migrations could then rely on. |
I absolutely agree with an async setup or preflight request to capture the data to be used by the migrations instead of providing async migrations. |
That is a good idea, it will solve the scenario and be more efficient at running. 👍 |
Updated the description based on the discussion. |
Discussed the idea with @rudolf and there are a few things to consider.
|
Because we don't currently have any migrations for the |
Discussed this with @pgayvallet and @wylieconlon and we came up with three potential solutions to #53972:
The Platform team favours (1) since it will improve the overall architecture of Kibana and has the lowest risk. This also buys us time to improve the saved object migration framework to be more resilient #52202 which we're targeting for 8.0.0 |
Pinging @elastic/kibana-platform (Team:Platform) |
I'm closing this as I'm not aware of any plugins requiring this functionality. Let me know if we should re-open it. @flash1293 I believe we've decided that the best way to implement the graph migration is to do that in the graph plugin itself during the @wylieconlon I'm not sure if we still want to implement #53972 but as far as I'm aware there's nothing preventing us from adopting the proposed solution to "Centralize all index-pattern loading to the data plugin and transform any index-pattern when it's loaded." |
I' bringing this back up because the discussion was closed the last time with these words:
Since then two other cases of the same problem emerged:
I'm not sure whether this is enough traction to justify further work, but in all of these cases imperfect workarounds had to be used - it seems unlikely this won't ever come up again plus there's now 3 places where legacy-handling code directly in the app outside of SO migration will have to be kept around indefinitely (or removed in a breaking change). |
@pgayvallet and I were talking about it this morning, and we tend to agree that this need will keep coming up. We will put this on our list of items to consider as possible 8.x projects, but it will require further discussion on our end. |
Problem:
SavedObject migrations are synchronous functions making it impossible to write migrations that require looking up some state from the old
.kibana
index being migrated.Describe a specific use case for the feature:
Once completed, this will unblock #34989. cc @flash1293
Proposed solution (updated after discussion below):
Allow migrations to provide an asynchronous pre-migration state collection function. The result of this function will be passed as an argument to each of the synchronous migration functions.
The text was updated successfully, but these errors were encountered: