-
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
Adapt the SOR for managed upgrades #150312
Labels
Epic:ZDTmigrations
Zero downtime migrations
Feature:Migrations
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Comments
This was referenced Feb 6, 2023
pgayvallet
added
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Epic:ZDTmigrations
Zero downtime migrations
labels
Feb 6, 2023
This was referenced Mar 1, 2023
This was referenced Mar 27, 2023
pgayvallet
added a commit
that referenced
this issue
Apr 3, 2023
…53921) ## Summary Fix #150301 Implements `DocumentMigrator.transformDown` and the associated transformation pipeline. Note: The feature is currently unused, and will only be when we'll start #150312 --------- Co-authored-by: kibanamachine <[email protected]>
pgayvallet
added a commit
that referenced
this issue
May 23, 2023
## Summary Part of #150312 (next steps depend on #153117) **This PR does two things:** - introduce the concept of version persistence schema - adapt the document migrator to support downward migrations for documents of an higher version. In the follow-up, we will then update the calls from the SOR to the document migrator to allow downward conversions when we're using the ZDT migration algorithm (which requires #153117 to be merged) ### Model version persistence schema. *(This is what has also been named 'eviction schema' or 'known fields schema'.)* A new `SavedObjectsModelVersion.schemas.backwardConversion` property was added to the model version definition. This 'schema' can either be an arbitrary function, or a `schema.object` from `@kbn/config-schema` ```ts type SavedObjectModelVersionBackwardConversionSchema< InAttrs = unknown, OutAttrs = unknown > = ObjectType | SavedObjectModelVersionBackwardConversionFn<InAttrs, OutAttrs>; ``` When specified for a version, the document's attributes will go thought this schema during down conversions by the document migrator. ### Adapt the document migrator to support downward migrations for documents of an higher version. Add an `allowDowngrade` option to `DocumentMigrator.migrate` and `KibanaMigrator.migrateDocument`. When this option is set to `true`, the document migration will accept to 'downgrade' the document if necessary, instead of throwing an error as done when the option is `false` or unspecified (which was the only behavior prior to this PR's changes) --------- Co-authored-by: kibanamachine <[email protected]>
delanni
pushed a commit
to delanni/kibana
that referenced
this issue
May 25, 2023
) ## Summary Part of elastic#150312 (next steps depend on elastic#153117) **This PR does two things:** - introduce the concept of version persistence schema - adapt the document migrator to support downward migrations for documents of an higher version. In the follow-up, we will then update the calls from the SOR to the document migrator to allow downward conversions when we're using the ZDT migration algorithm (which requires elastic#153117 to be merged) ### Model version persistence schema. *(This is what has also been named 'eviction schema' or 'known fields schema'.)* A new `SavedObjectsModelVersion.schemas.backwardConversion` property was added to the model version definition. This 'schema' can either be an arbitrary function, or a `schema.object` from `@kbn/config-schema` ```ts type SavedObjectModelVersionBackwardConversionSchema< InAttrs = unknown, OutAttrs = unknown > = ObjectType | SavedObjectModelVersionBackwardConversionFn<InAttrs, OutAttrs>; ``` When specified for a version, the document's attributes will go thought this schema during down conversions by the document migrator. ### Adapt the document migrator to support downward migrations for documents of an higher version. Add an `allowDowngrade` option to `DocumentMigrator.migrate` and `KibanaMigrator.migrateDocument`. When this option is set to `true`, the document migration will accept to 'downgrade' the document if necessary, instead of throwing an error as done when the option is `false` or unspecified (which was the only behavior prior to this PR's changes) --------- Co-authored-by: kibanamachine <[email protected]>
Closing as we have #165434 for tracking the last remaining piece of this work. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Epic:ZDTmigrations
Zero downtime migrations
Feature:Migrations
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Part of #150296
This issue is here to track the changes required by managed upgrades in the SOR implementation.
(Each bullet point should be an issue, they will be created when necessary)
MVP
Converting document to the correct version (check the current version from the index's meta and use it)
Add
schema
support to model versionsschema
#152994Make update method up/down safe
Short term
Later / eventually
Polling the index for model version SOR: implement polling to retrieve the current model version #152809
Handle
fields
option forfind
during ZDT migrations - SOR: documentfields
behavior and best practices during the transition phase in ZDT #153766Add API to expose current model version to plugins // depends on polling
The text was updated successfully, but these errors were encountered: