Skip to content

Migrations v2 ignore fleet agent events - #96690

Merged
rudolf merged 5 commits into
elastic:masterfrom
rudolf:migrations-v2-ignore-fleet-agent-events
Apr 12, 2021
Merged

rudolf merged 5 commits into
elastic:masterfrom
rudolf:migrations-v2-ignore-fleet-agent-events

Conversation

@rudolf

@rudolf rudolf commented Apr 9, 2021 •

Copy link
Copy Markdown
Contributor

Summary

Ignore fleet-agent-events and tsvb-validation-telemetry saved objects from both v1 and v2 migrations.

Fixes #95617
Fixes #91869

Release notes

Users who tried the fleet agent beta in 7.10 might have hundreds of thousands of fleet-agent-events in their .kibana index. Due to the large volume of documents, upgrades to 7.12 would frequently fail for these users. In 7.12.1 we drop all fleet-agent-events during the upgrade migration to address this problem. The fleet-agent-events documents are still left in the older .kibana_N index from previous versions, once the upgrade has succeeded we recommend deleting these indices to recover the disk space, see https://www.elastic.co/guide/en/kibana/current/upgrade-migrations.html#upgrade-migrations-old-indices

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@rudolf rudolf added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient v7.12.1 v7.13.0 v8.0.0 labels Apr 9, 2021
@rudolf
rudolf marked this pull request as ready for review April 9, 2021 13:21
@rudolf
rudolf requested a review from a team as a code owner April 9, 2021 13:21
@elasticmachine

Copy link
Copy Markdown
Contributor

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

});

it('should create or update the fleet_enroll user if called multiple times with forceRecreate flag', async () => {
it.skip('should create or update the fleet_enroll user if called multiple times with forceRecreate flag', async () => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@elastic/fleet @nchaulet somehow this test is failing when I remove fleet-agent-events. The same test also fails on master if I enable v1 migrations for this test with the following:

--- a/x-pack/test/fleet_api_integration/config.ts
+++ b/x-pack/test/fleet_api_integration/config.ts
@@ -65,6 +65,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
     kbnTestServer: {
       ...xPackAPITestsConfig.get('kbnTestServer'),
       serverArgs: [
+        '--migrations.enableV2=false',
         ...xPackAPITestsConfig.get('kbnTestServer.serverArgs'),
         ...(registryPort ? [`--xpack.fleet.registryUrl=http://localhost:${registryPort}`] : []),
       ],

We're targeting 7.12.1 for this fix, so please take a look and let me know if it's possible to fix this test or if we should skip it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's okay to skip it, we are going to remove that API in 7.13.

@botelastic botelastic Bot added the Team:Fleet - DEPRECATED Use Team:streams-ui label Apr 9, 2021
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@afharo afharo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀 LGTM! Just added a NIT about term vs. terms. According to https://discuss.elastic.co/t/term-vs-terms-filter/15533, the only difference in performance is caching. Since, ideally, we should be running this once, I guess it makes no difference.

Comment thread src/core/server/saved_objects/migrations/core/elastic_index.ts
Comment thread src/core/server/saved_objects/migrationsv2/actions/index.ts
@rudolf

rudolf commented Apr 12, 2021

Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibanamachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@rudolf rudolf added the auto-backport Deprecated - use backport:version if exact versions are needed label Apr 12, 2021
@rudolf
rudolf merged commit f544d8d into elastic:master Apr 12, 2021
@rudolf
rudolf deleted the migrations-v2-ignore-fleet-agent-events branch April 12, 2021 16:19
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 12, 2021
* migrationsv2: ignore fleet agent events and tsvb telemetry

* migrationsv1: ignore tsvb-validation-telemetry

* Skip fleet test that depends on fleet-agent-events

* Fix typescript errors

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

Copy link
Copy Markdown
Contributor

💔 Backport failed

Status Branch Result
❌ 7.12 Commit could not be cherrypicked due to conflicts
✅ 7.x

Successful backport PRs will be merged automatically after passing CI.

To backport manually run:
node scripts/backport --pr 96690

kibanamachine added a commit that referenced this pull request Apr 12, 2021
* migrationsv2: ignore fleet agent events and tsvb telemetry

* migrationsv1: ignore tsvb-validation-telemetry

* Skip fleet test that depends on fleet-agent-events

* Fix typescript errors

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

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
rudolf added a commit to rudolf/kibana that referenced this pull request Apr 12, 2021
* migrationsv2: ignore fleet agent events and tsvb telemetry

* migrationsv1: ignore tsvb-validation-telemetry

* Skip fleet test that depends on fleet-agent-events

* Fix typescript errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	src/core/server/saved_objects/migrationsv2/integration_tests/actions.test.ts
pgayvallet added a commit that referenced this pull request Apr 13, 2021
…sted sessions (#96938) (#96892)

* Migrations v2 ignore fleet agent events (#96690)

* migrationsv2: ignore fleet agent events and tsvb telemetry

* migrationsv1: ignore tsvb-validation-telemetry

* Skip fleet test that depends on fleet-agent-events

* Fix typescript errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	src/core/server/saved_objects/migrationsv2/integration_tests/actions.test.ts

* Correctly fix merge conflicts

* Skip failing fleet-agent-events tests

* Skip security solution endpoint telemetry tests depending on fleet-agent-events so's

* Exclude non-persisted sessions from SO migration (#96938)

(cherry picked from commit bfd5b7b)

* use `any` for estypes.QueryContainer

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
@tonymeehan

Copy link
Copy Markdown

👍 🥇 💯

patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
* migrationsv2: ignore fleet agent events and tsvb telemetry

* migrationsv1: ignore tsvb-validation-telemetry

* Skip fleet test that depends on fleet-agent-events

* Fix typescript errors

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

auto-backport Deprecated - use backport:version if exact versions are needed project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient release_note:fix Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// Team:Fleet - DEPRECATED Use Team:streams-ui v7.12.1 v7.13.0 v8.0.0

Projects

None yet

6 participants