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

[docs] Resolving failed Kibana upgrade migrations #80999

Merged
merged 8 commits into from Oct 27, 2020

Conversation

rudolf
Copy link
Contributor

@rudolf rudolf commented Oct 19, 2020

Summary

Documentation for resolving failed Kibana upgrade migrations. Related to #80283

This provides instructions for retrying failed upgrade migrations, or rolling back to a previous migration using snapshots. Using snapshots makes this process significantly simpler and much harder to accidentally remove the wrong index or forget to add the correct alias etc etc.

TODO:

  • Does not touch on resolving the root cause of a migration failure. Sometimes failures happen because of transient problems, but if the cause is persistent (ES out of disk space, ES cluster doesn't have enough heap, a document throws an exception while being transformed) then retrying the migration won't resolve the problem.
  • Problems caused by the unsupported config value xpack.tasks.index: .tasks
  • Problems caused by index templates which change the mappings or the refresh_interval index setting for newly created indices.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@rudolf rudolf added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Saved Objects docs labels Oct 19, 2020
@rudolf rudolf self-assigned this Oct 19, 2020
@rudolf rudolf added this to Pending Review in kibana-core [DEPRECATED] via automation Oct 19, 2020
@rudolf rudolf marked this pull request as ready for review October 20, 2020 19:40
@elasticmachine
Copy link
Contributor

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

@lcawl
Copy link
Contributor

lcawl commented Oct 20, 2020

@elasticmachine merge upstream

@lcawl lcawl added release_note:skip Skip the PR/issue when compiling release notes v8.0.0 labels Oct 20, 2020
@pgayvallet
Copy link
Contributor

@rudolf I see TODOs in the summary. Is this ready for review?

* Shut down all {kib} nodes. Running more than one {kib} version against the
same Elasticseach index is unsupported. If you upgrade while older {kib} nodes are
running, the upgrade can fail.
* Shut down all {kib} instances. Running more than one {kib} version against
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bullet point about shutting down all Kibana instances (i.e., maintenance window/downtime required) is often missed. It might be helpful to highlight this in a warning statement and call out the expected downtime.

the appropriate {kib} index. When you have the previous version running again,
delete the more recent `.kibana_N` index or indices so that future upgrades are
based on the current {kib} index. You must restart {kib} to re-trigger the migration.
In order to rollback after a failed upgrade migration, the saved object indices might also have to be rolled back to be compatible with the previous {kibana} version.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any guidelines on how the user can determine if there are objects that need to be rolled back to be compatible with previous Kibana version? (i.e., if they have to follow the "Rolling back to a previous version of ..." section in addition to the "Resolving migration failures" section)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that would be useful to flesh out. In short, if you get unhandled exceptions it's worth retrying the migration to see if it would succeed. If a specific document fails to migrate retrying won't help, so you can either delete the document and retry, or rollback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a "preventing migration failures" section. In the rollback instructions I now added: if you tried the preventing migration failures and resolving migration failures and still can't upgrade you might choose to rollback.

[float]
[[upgrade-before-you-begin]]
=== Before you begin

WARNING: {kib} automatically runs upgrade migrations when required. To roll back to an earlier version in case of an upgrade failure, you **must** have a backup snapshot available. Use <<snapshot-repositories, Snapshot and Restore>> to back up {kib} data by targeting the `.kibana*` indices. For more information see <<upgrade-migrations, upgrade-migrations>>.

Before you upgrade {kib}:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on adding another item here to prevent custom index templates from interfering with .kibana* indices?
i.e., remove any custom index template that might accidentally "cover" .kibana* indices. This can help avoid saved objects migration issues due to custom index templates causing invalid/unexpected mappings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the "preventing migration failures" section and linked to it from here.

@rudolf
Copy link
Contributor Author

rudolf commented Oct 22, 2020

@rudolf I see TODOs in the summary. Is this ready for review?

@pgayvallet I've addressed the remaining todo's now.

@rudolf
Copy link
Contributor Author

rudolf commented Oct 26, 2020

@elasticmachine merge upstream

@rudolf rudolf added the v7.10.0 label Oct 26, 2020
Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. That's some great doc improvements!

Comment on lines +17 to +18
* `.kibana_N`, or if set, the `kibana.index` configuration setting
* `.kibana_task_manager_N`, or if set, the `xpack.tasks.index` configuration setting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I would replace .kibana_N with .kibana_{N} and .kibana_N+1 with .kibana_{N+1}, but this is a developer point of view, not sure this is more readable for the target audience.

rudolf added a commit to rudolf/kibana that referenced this pull request Oct 27, 2020
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc
rudolf added a commit that referenced this pull request Oct 27, 2020
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rudolf added a commit that referenced this pull request Oct 27, 2020
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rudolf added a commit that referenced this pull request Oct 27, 2020
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rudolf added a commit that referenced this pull request Oct 27, 2020
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rudolf added a commit that referenced this pull request Oct 27, 2020
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc
rudolf added a commit to rudolf/kibana that referenced this pull request Oct 27, 2020
…astic#81810)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc
rudolf added a commit to rudolf/kibana that referenced this pull request Oct 27, 2020
…astic#81810)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc
gmmorris added a commit to gmmorris/kibana that referenced this pull request Oct 27, 2020
* master: (87 commits)
  [Actions] Adding `hasAuth` to Webhook Configuration to avoid confusing UX (elastic#81778)
  [i18n] add get_kibana_translation_paths tests (elastic#81624)
  [UX] Fix search term reset from url (elastic#81654)
  [Lens] Improved range formatter (elastic#80132)
  [Resolver] `SideEffectContext` changes, remove `@testing-library` uses (elastic#81077)
  [Time to Visualize] Update Library Text with Call to Action (elastic#81667)
  [docs] Resolving failed Kibana upgrade migrations (elastic#80999)
  [ftr/menuToggle] provide helper for enhanced menu toggle handling (elastic#81709)
  [Task Manager] adds basic observability into Task Manager's runtime operations (elastic#77868)
  Doc changes for stack management and grouped feature privileges (elastic#80486)
  Added functional test for alerts list filters by status, alert type and action type. Did a code refactoring and splitting for alerts tests. (elastic#81422)
  [Security Solution][Endpoint][Admin] Malware Protections Notify User Version (elastic#81415)
  Revert "[Actions] Adding `hasAuth` to Webhook Configuration to avoid confusing UX (elastic#81390)"
  [Maps] Use default format when proxying EMS-files (elastic#79760)
  [Discover] Deangularize context.html (elastic#81442)
  Use the displayName property in default editor (elastic#73311)
  adds bug label to Bug report for Security Solution template (elastic#81643)
  [ML] Transforms: Remove index field limitation for custom query. (elastic#81467)
  [Actions] Adding `hasAuth` to Webhook Configuration to avoid confusing UX (elastic#81390)
  [Task Manager] Mark task as failed if maxAttempts has been met. (elastic#80681)
  ...
rudolf added a commit that referenced this pull request Oct 28, 2020
…81814)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc
rudolf added a commit that referenced this pull request Oct 28, 2020
…81813)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rudolf added a commit to rudolf/kibana that referenced this pull request Oct 28, 2020
…astic#81810)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc
rudolf added a commit that referenced this pull request Oct 29, 2020
) (#81882)

* [docs] Resolving failed Kibana upgrade migrations (#80999) (#81810)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc

* Adapt upgrade migration documentation for <= 7.3
rudolf added a commit to rudolf/kibana that referenced this pull request Oct 29, 2020
… (elastic#81810) (elastic#81882)

* [docs] Resolving failed Kibana upgrade migrations (elastic#80999) (elastic#81810)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc

* Adapt upgrade migration documentation for <= 7.3
# Conflicts:
#	docs/setup/upgrade.asciidoc
rudolf added a commit to rudolf/kibana that referenced this pull request Oct 29, 2020
… (elastic#81810) (elastic#81882)

* [docs] Resolving failed Kibana upgrade migrations (elastic#80999) (elastic#81810)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc

* Adapt upgrade migration documentation for <= 7.3
# Conflicts:
#	docs/setup/upgrade.asciidoc
rudolf added a commit to rudolf/kibana that referenced this pull request Oct 29, 2020
… (elastic#81810) (elastic#81882)

* [docs] Resolving failed Kibana upgrade migrations (elastic#80999) (elastic#81810)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc

* Adapt upgrade migration documentation for <= 7.3
# Conflicts:
#	docs/setup/upgrade.asciidoc
rudolf added a commit that referenced this pull request Oct 29, 2020
) (#81882) (#81985)

* [docs] Resolving failed Kibana upgrade migrations (#80999) (#81810)

* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	docs/setup/upgrade.asciidoc
#	docs/setup/upgrade/upgrade-migrations.asciidoc
#	docs/setup/upgrade/upgrade-standard.asciidoc

* Adapt upgrade migration documentation for <= 7.3
# Conflicts:
#	docs/setup/upgrade.asciidoc
rudolf added a commit to rudolf/kibana that referenced this pull request Jan 26, 2021
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rudolf added a commit to rudolf/kibana that referenced this pull request Jan 26, 2021
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rudolf added a commit that referenced this pull request Jan 26, 2021
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rudolf added a commit that referenced this pull request Jan 26, 2021
* Resolving failed Kibana upgrade migrations

* Move warning against rolling upgrades into upgrade-standard and call out stopping all instances in specific upgrade steps

* Add preventing migration failures section

* Add incompatible xpack.tasks.index: .tasks setting to preventing migration failures

* Fix link

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Feature:Saved Objects release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.10.0 v8.0.0
Projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants