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

Tag invalid objects instead of failing migrations #55406

Open
rudolf opened this issue Jan 21, 2020 · 3 comments
Open

Tag invalid objects instead of failing migrations #55406

rudolf opened this issue Jan 21, 2020 · 3 comments
Assignees
Labels
Feature:New Platform 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

@rudolf
Copy link
Contributor

rudolf commented Jan 21, 2020

Don't fail migrations if an invalid object is encountered, but tag object as invalid

  1. Tag objects as “invalid” if they cause an exception when being migrated, but don’t fail the entire migration.
  2. Log an error message informing administrators that there are invalid objects which require inspection. For each invalid object, provide an error stack trace to aid in debugging.
  3. Administrators should be able to generate a migration report (similar to the one dry run migrations create) which is an NDJSON export of all objects tagged as “invalid”.
  4. When an invalid object is read the Saved Objects client will throw an invalid object exception which should include a link to documentation to help administrators resolve migration bugs.
  5. Educate Kibana developers to no longer simply write back an unmigrated document if an exception occurred. A migration should either successfully transform the object or throw.

Part of #52202

@rudolf rudolf added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform Feature:Saved Objects labels Jan 21, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@rudolf rudolf added this to Prioritized Backlog in kibana-core [DEPRECATED] Jan 21, 2020
@joshdover joshdover moved this from Prioritized Backlog to 7.7 in kibana-core [DEPRECATED] Mar 2, 2020
@joshdover joshdover moved this from 7.7 to 7.8 - Tentative in kibana-core [DEPRECATED] Mar 24, 2020
@joshdover joshdover moved this from 7.8 to 7.9 - Tentative in kibana-core [DEPRECATED] Apr 21, 2020
@joshdover joshdover moved this from 7.9 - Tentative to In Progress in kibana-core [DEPRECATED] May 7, 2020
@rudolf
Copy link
Contributor Author

rudolf commented Jun 30, 2020

From Section 5.5 in the "Improve saved object migrations RFC" #66056

Although it seems preferable to not fail the entire migration because of a single saved object type's migration transform bug or a single invalid document this has several pitfalls:

  • When an object fails to migrate the data for that saved object type becomes inconsistent. This could load to a critical feature being unavailable to a user leaving them with no choice but to downgrade.
  • Because Kibana starts accepting traffic after encountering invalid objects a rollback will lead to data loss leaving users with no clean way to recover.

As a result we prefer to let an upgrade fail and making it easy for users to rollback until they can resolve the root cause.

@rudolf rudolf closed this as completed Jun 30, 2020
kibana-core [DEPRECATED] automation moved this from In Progress to Done (7.9) Jun 30, 2020
@pgayvallet pgayvallet added the project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient label Jun 29, 2021
@pgayvallet
Copy link
Contributor

Reopening, as this may be required for some of the possible enhancements we could implement.

@pgayvallet pgayvallet reopened this Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform 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
Development

No branches or pull requests

3 participants