-
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
Do not skip UPDATE_TARGET_MAPPINGS if upgrading to a newer stack version #147503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes LGTM! However, I'd defer the approval to someone else with more experience in SO migrations.
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
To update your PR or re-run it, just comment with: |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ion (elastic#147503) Fixes elastic#147450 (cherry picked from commit 4f72a2e)
…ion (elastic#147503) Fixes elastic#147450 (cherry picked from commit 4f72a2e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…k version (#147503) (#147522) # Backport This will backport the following commits from `main` to `8.6`: - [Do not skip UPDATE_TARGET_MAPPINGS if upgrading to a newer stack version (#147503)](#147503) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-12-14T13:39:47Z","message":"Do not skip UPDATE_TARGET_MAPPINGS if upgrading to a newer stack version (#147503)\n\nFixes https://github.com/elastic/kibana/issues/147450","sha":"4f72a2eb5beded9a3086de7766021d9b65a197f3","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","Feature:Migrations","backport:prev-minor","v8.6.0","v8.7.0","v8.6.1"],"number":147503,"url":"https://github.com/elastic/kibana/pull/147503","mergeCommit":{"message":"Do not skip UPDATE_TARGET_MAPPINGS if upgrading to a newer stack version (#147503)\n\nFixes https://github.com/elastic/kibana/issues/147450","sha":"4f72a2eb5beded9a3086de7766021d9b65a197f3"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/147503","number":147503,"mergeCommit":{"message":"Do not skip UPDATE_TARGET_MAPPINGS if upgrading to a newer stack version (#147503)\n\nFixes https://github.com/elastic/kibana/issues/147450","sha":"4f72a2eb5beded9a3086de7766021d9b65a197f3"}}]}] BACKPORT--> Co-authored-by: Gerard Soldevila <[email protected]>
* main: (21 commits) [Profiling] Remove link to 'Other' bucket (elastic#147523) [Synthetics UI] Add missing configuration options to the add/edit monitor forms (elastic#147265) [DOCS] Updates what's new pages (elastic#147483) [Fleet][Endpoint][RBAC V2] Update fleet router and config to allow API access via RBAC controls (elastic#145361) [Guided onboarding] Update guide IDs (elastic#147348) [Synthetics] Add synthetics settings alerting default (elastic#147339) [Security Solution][Endpoint] Fix Policy form being displayed as Read Only when displayed in Fleet pages (elastic#147212) [Cases] Save draft user comment (elastic#146327) [API Docs] Fix `--plugin` filter (elastic#147500) [Fleet] added a logic to use `destinationId` when tagging imported SOs (elastic#147439) Do not skip UPDATE_TARGET_MAPPINGS if upgrading to a newer stack version (elastic#147503) [Discover] Validate if Data View time field exists on Alert creation / editing (elastic#146324) [Discover] Fix Discover navigation from Lens embeddable (elastic#147000) Allow users to Update API Keys (elastic#146237) Update dependency xstate to ^4.35.0 (main) (elastic#147463) [Behavioral Analytics] Remove feature flag to hide functionality (elastic#147429) [Fleet] Add agent policy `inactivity_timeout`experimental setting (elastic#147432) [APM] Switching service groups from grid to flex layout (elastic#147448) [Fleet] Add missing endpoints to openApi specs (elastic#147452) [AO] Allow providing custom time range for Alert Summary Widget (elastic#147253) ...
Fixes #124946 ## Summary Takes a step toward optimising our migration paths by only reindexing (an expensive operation) when needed by checking whether the current SO mappings have "changed". By "changed" we mean that we have detected a new md5 checksum of any registered saved object type relative to the hashes we have stored. ## How to test These changes are constrained to the `model.ts`, a test was added for correctly detecting that mappings are the same during the `INIT` phase to send us down the correct migration path. Additionally, we have a new Jest integration test `skip_reindex.test.ts` that runs Kibana and inspects the logs for the expected model transitions. Everything else should remain the same. ## Happy path for skipping reindex ``` RUN INIT IF !versionMigrationIsComplete AND !kibana indexBelongsToLaterVersion AND !waitForMigrationCompletion AND mappingsAreUnchanged THEN the migration operations must target the existing .kibana_x.y.z_001 index RUN PREPARE_COMPATIBLE_MIGRATION (new state) we remove old version aliases (prevent old reads/writes), and set the current version alias (prevent old migrations) SKIP LEGACY_SET_WRITE_BLOCK SKIP ... SKIP SET_SOURCE_WRITE_BLOCK SKIP ... SKIP REFRESH_TARGET RUN OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT ... RUN MARK_VERSION_INDEX_READY DONE ``` ## Notes * This optimisation will only be triggered when there are no mappings changes AND we are upgrading to a new version. This does not cover all cases. In future we will make this more sophisticated by checking for incompatible changes to mappings and only reindexing when those occur. ## Related * #147503 ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Gerard Soldevila <[email protected]>
Fixes #147450