[Fleet] Rollover data streams when package w/ TSDB setting changed is installed#157869
[Fleet] Rollover data streams when package w/ TSDB setting changed is installed#157869kpollich merged 5 commits intoelastic:mainfrom
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts
Outdated
Show resolved
Hide resolved
juliaElastic
left a comment
There was a problem hiding this comment.
LGTM.
Can we add an integration test on this that verifies that the rollover is happening? We could add in a separate pr.
juliaElastic
left a comment
There was a problem hiding this comment.
LGTM.
Can we add an integration test on this that verifies that the rollover is happening? We could add in a separate pr.
x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts
Outdated
Show resolved
Hide resolved
|
Probably related to #157869 |
|
@elasticmachine merge upstream |
|
Pinging @elastic/fleet (Team:Fleet) |
|
Tests added + other feedback addressed in b0b9281 |
|
I'm going to enable auto merge here to resolve Fleet's part of the release blocker, but elastic/elasticsearch#96163 will still be considered an ES blocker on toggling TSDB from packages. It's likely when testing TSDB migration packages we'll run into the conflicting range rollover errors. |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @kpollich |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… installed (elastic#157869) ## Summary Fixes elastic#157345 When a package with a changed `index.mode` or `source.mode` setting is installed, Fleet will now automatically perform a rollover to ensure the correct setting is present on the resulting backing index. There is an issue with Elasticsearch wherein toggling these settings back and forth will incur a backing index range overlap error. See elastic/elasticsearch#96163. To test 1. Install the `system` integration at version `1.28.0` 2. Create an integration policy for the `system` integration (a standard default agent policy will do) 3. Enroll an agent in this policy, and allow it to ingest some data 4. Confirm that there are documents present in the `metrics-system.cpu-default` data stream, and note its backing index via Stack Management 5. Create a new `1.28.1` version of the `system` integration where `elasticsearch.index_mode: time_series` is set and install it via `elastic-package install --zip` 6. Confirm that a rollover occurs and the backing index for the `metrics-system.cpu-default` data stream has been updated ### Checklist Delete any items that are not applicable to this PR. - [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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 22e3847)
…ged is installed (#157869) (#157916) # Backport This will backport the following commits from `main` to `8.8`: - [[Fleet] Rollover data streams when package w/ TSDB setting changed is installed (#157869)](#157869) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kyle Pollich","email":"kyle.pollich@elastic.co"},"sourceCommit":{"committedDate":"2023-05-16T18:16:14Z","message":"[Fleet] Rollover data streams when package w/ TSDB setting changed is installed (#157869)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/157345\r\n\r\nWhen a package with a changed `index.mode` or `source.mode` setting is\r\ninstalled, Fleet will now automatically perform a rollover to ensure the\r\ncorrect setting is present on the resulting backing index.\r\n\r\nThere is an issue with Elasticsearch wherein toggling these settings\r\nback and forth will incur a backing index range overlap error. See\r\nhttps://github.com/elastic/elasticsearch/issues/96163.\r\n\r\nTo test\r\n1. Install the `system` integration at version `1.28.0`\r\n2. Create an integration policy for the `system` integration (a standard\r\ndefault agent policy will do)\r\n3. Enroll an agent in this policy, and allow it to ingest some data\r\n4. Confirm that there are documents present in the\r\n`metrics-system.cpu-default` data stream, and note its backing index via\r\nStack Management\r\n5. Create a new `1.28.1` version of the `system` integration where\r\n`elasticsearch.index_mode: time_series` is set and install it via\r\n`elastic-package install --zip`\r\n6. Confirm that a rollover occurs and the backing index for the\r\n`metrics-system.cpu-default` data stream has been updated\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"22e38472f6f05f9e72d97e74ff8328565da4d53b","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v8.9.0"],"number":157869,"url":"https://github.com/elastic/kibana/pull/157869","mergeCommit":{"message":"[Fleet] Rollover data streams when package w/ TSDB setting changed is installed (#157869)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/157345\r\n\r\nWhen a package with a changed `index.mode` or `source.mode` setting is\r\ninstalled, Fleet will now automatically perform a rollover to ensure the\r\ncorrect setting is present on the resulting backing index.\r\n\r\nThere is an issue with Elasticsearch wherein toggling these settings\r\nback and forth will incur a backing index range overlap error. See\r\nhttps://github.com/elastic/elasticsearch/issues/96163.\r\n\r\nTo test\r\n1. Install the `system` integration at version `1.28.0`\r\n2. Create an integration policy for the `system` integration (a standard\r\ndefault agent policy will do)\r\n3. Enroll an agent in this policy, and allow it to ingest some data\r\n4. Confirm that there are documents present in the\r\n`metrics-system.cpu-default` data stream, and note its backing index via\r\nStack Management\r\n5. Create a new `1.28.1` version of the `system` integration where\r\n`elasticsearch.index_mode: time_series` is set and install it via\r\n`elastic-package install --zip`\r\n6. Confirm that a rollover occurs and the backing index for the\r\n`metrics-system.cpu-default` data stream has been updated\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"22e38472f6f05f9e72d97e74ff8328565da4d53b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157869","number":157869,"mergeCommit":{"message":"[Fleet] Rollover data streams when package w/ TSDB setting changed is installed (#157869)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/157345\r\n\r\nWhen a package with a changed `index.mode` or `source.mode` setting is\r\ninstalled, Fleet will now automatically perform a rollover to ensure the\r\ncorrect setting is present on the resulting backing index.\r\n\r\nThere is an issue with Elasticsearch wherein toggling these settings\r\nback and forth will incur a backing index range overlap error. See\r\nhttps://github.com/elastic/elasticsearch/issues/96163.\r\n\r\nTo test\r\n1. Install the `system` integration at version `1.28.0`\r\n2. Create an integration policy for the `system` integration (a standard\r\ndefault agent policy will do)\r\n3. Enroll an agent in this policy, and allow it to ingest some data\r\n4. Confirm that there are documents present in the\r\n`metrics-system.cpu-default` data stream, and note its backing index via\r\nStack Management\r\n5. Create a new `1.28.1` version of the `system` integration where\r\n`elasticsearch.index_mode: time_series` is set and install it via\r\n`elastic-package install --zip`\r\n6. Confirm that a rollover occurs and the backing index for the\r\n`metrics-system.cpu-default` data stream has been updated\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"22e38472f6f05f9e72d97e74ff8328565da4d53b"}}]}] BACKPORT--> Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
… installed (#157869) ## Summary Fixes #157345 When a package with a changed `index.mode` or `source.mode` setting is installed, Fleet will now automatically perform a rollover to ensure the correct setting is present on the resulting backing index. There is an issue with Elasticsearch wherein toggling these settings back and forth will incur a backing index range overlap error. See elastic/elasticsearch#96163. To test 1. Install the `system` integration at version `1.28.0` 2. Create an integration policy for the `system` integration (a standard default agent policy will do) 3. Enroll an agent in this policy, and allow it to ingest some data 4. Confirm that there are documents present in the `metrics-system.cpu-default` data stream, and note its backing index via Stack Management 5. Create a new `1.28.1` version of the `system` integration where `elasticsearch.index_mode: time_series` is set and install it via `elastic-package install --zip` 6. Confirm that a rollover occurs and the backing index for the `metrics-system.cpu-default` data stream has been updated ### Checklist Delete any items that are not applicable to this PR. - [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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Fixes #157345
When a package with a changed
index.modeorsource.modesetting is installed, Fleet will now automatically perform a rollover to ensure the correct setting is present on the resulting backing index.There is an issue with Elasticsearch wherein toggling these settings back and forth will incur a backing index range overlap error. See elastic/elasticsearch#96163.
To test
systemintegration at version1.28.0systemintegration (a standard default agent policy will do)metrics-system.cpu-defaultdata stream, and note its backing index via Stack Management1.28.1version of thesystemintegration whereelasticsearch.index_mode: time_seriesis set and install it viaelastic-package install --zipmetrics-system.cpu-defaultdata stream has been updatedChecklist
Delete any items that are not applicable to this PR.