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

[SO Migration] add an API to notify that a type is no longer used #104246

Open
pgayvallet opened this issue Jul 2, 2021 · 1 comment
Open

[SO Migration] add an API to notify that a type is no longer used #104246

pgayvallet opened this issue Jul 2, 2021 · 1 comment
Labels
Feature:Saved Objects project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@pgayvallet
Copy link
Contributor

pgayvallet commented Jul 2, 2021

At the moment, if a SO type is no longer registered, it will cause the migration to the next version to fail, as we’re checking for unknown doc types during one of the migration’s preflight checks.

This already occurred once with the tsvb-validation-telemetry type in #95617

Our only workaround for now is to update an internal core variable containing an ES filter of all the documents we should ignore during the migration.

export const excludeUnusedTypesQuery: estypes.QueryDslQueryContainer = {
bool: {
must_not: [
// https://github.com/elastic/kibana/issues/91869
{
term: {
type: 'fleet-agent-events',
},
},

The core savedObjects service should either extend the current registerType API, or create a new registerDeprecatedType one, to let type owners have proper control on type deprecation/removal.

To future-proof us against potential type renaming and such, I think we should also ask the owners to specify the version the type was removed at, so the API could look like

registerDeprecatedType(typeName: string, since: VersionString);
@pgayvallet pgayvallet added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Saved Objects project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient labels Jul 2, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Saved Objects project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

2 participants