forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apm-data] Apply lazy rollover on index template creation (elastic#11…
…6219) * Apply lazy rollover on index template creation We should trigger a lazy rollover of existing data streams regardless of whether the index template is being created or updated. This ensures that the apm-data plugin will roll over data streams that were previously using the Fleet integration package. * Update docs/changelog/116219.yaml * Update docs/changelog/116219.yaml * Add YAML REST test for template reinstallation * Code review suggestion elastic#116219 (comment) * Remove wait_for_events from setup This doesn't guarantee the templates are set up, it only increases the chances; and we disable the plugin at the start of the test anyway.
- Loading branch information
Showing
8 changed files
with
146 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 116219 | ||
summary: "[apm-data] Apply lazy rollover on index template creation" | ||
area: Data streams | ||
type: bug | ||
issues: | ||
- 116230 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
x-pack/plugin/apm-data/src/yamlRestTest/resources/rest-api-spec/test/10_rollover.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
setup: | ||
- do: | ||
indices.put_index_template: | ||
name: traces-low-prio | ||
body: | ||
data_stream: {} | ||
index_patterns: ["traces-*"] | ||
priority: 1 | ||
|
||
--- | ||
"Test data stream rollover on template installation": | ||
- skip: | ||
awaits_fix: "https://github.com/elastic/elasticsearch/issues/102360" | ||
|
||
# Disable the apm-data plugin and delete the traces-apm@template index | ||
# template so traces-low-prio takes effect. | ||
- do: | ||
cluster.put_settings: | ||
body: | ||
transient: | ||
xpack.apm_data.registry.enabled: false | ||
- do: | ||
indices.delete_index_template: | ||
name: traces-apm@template | ||
- do: | ||
indices.create_data_stream: | ||
name: traces-apm-testing | ||
- do: | ||
indices.get_data_stream: | ||
name: traces-apm-testing | ||
- match: {data_streams.0.template: traces-low-prio} | ||
|
||
# Re-enable the apm-data plugin, after which the traces-apm@template | ||
# index template should be recreated and trigger a lazy rollover on | ||
# the traces-apm-testing data stream. | ||
- do: | ||
cluster.put_settings: | ||
body: | ||
transient: | ||
xpack.apm_data.registry.enabled: true | ||
- do: | ||
cluster.health: | ||
wait_for_events: languid | ||
- do: | ||
indices.get_data_stream: | ||
name: traces-apm-testing | ||
- length: {data_streams: 1} | ||
- match: {data_streams.0.template: traces-apm@template} | ||
- match: {data_streams.0.rollover_on_write: true} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters