-
Notifications
You must be signed in to change notification settings - Fork 525
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
New indexes created for datastreams after update to 8.15.0
are without lifecycle policies
#13898
New indexes created for datastreams after update to 8.15.0
are without lifecycle policies
#13898
Comments
The fix for |
I don't love elastic/elasticsearch#112097 as a solution, since it kinda implies we'll keep the old ILM config around in the index templates for perpetuity. Perhaps we can remove that while also addressing serverless, by dynamically injecting the ILM config into the index template if there are existing indices with ILM config? |
We need to handle the following scenarios:
|
With the current changes, the custom ILM policies would break even for versions >= 8.15.1 as index templates cannot be overridden. elastic/elasticsearch#112432 provides a fix for this by moving the fallback to component template which could be overridden as required. NOTE that this would also require us to update our documents for configuring custom ILM policy to include Testing elastic/elasticsearch#112432 locally
✅ Tested (new cluster created locally){
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "4rLT17ZQQIC6mFDlPS1SNA",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Data stream lifecycle"
}
],
"generation": 1,
"_meta": {
"description": "Index template for traces-apm-*",
"managed": true
},
"status": "YELLOW",
"template": "traces-apm@template",
"lifecycle": {
"enabled": true,
"data_retention": "10d"
},
"ilm_policy": "traces-apm.traces-default_policy",
"next_generation_managed_by": "Data stream lifecycle",
"prefer_ilm": false,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": true,
"indices": []
}
}
]
}
✅ Tested by created traces-apm@custom component template with a custom ILM policy but prefer_ilm as falseSince the prefer_ilm is {
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "4rLT17ZQQIC6mFDlPS1SNA",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Data stream lifecycle"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "FeVicze2S7ex5o7R7yeLaQ",
"prefer_ilm": false,
"ilm_policy": "custom-ilm-override-dsl",
"managed_by": "Data stream lifecycle"
}
],
"generation": 2,
"_meta": {
"description": "Index template for traces-apm-*",
"managed": true
},
"status": "YELLOW",
"template": "traces-apm@template",
"lifecycle": {
"enabled": true,
"data_retention": "10d"
},
"ilm_policy": "custom-ilm-override-dsl",
"next_generation_managed_by": "Data stream lifecycle",
"prefer_ilm": false,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": true,
"indices": []
}
}
]
} ✅ Tested by updating traces-apm@custom component template to include prefer_ilm as true{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "4rLT17ZQQIC6mFDlPS1SNA",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Data stream lifecycle"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "FeVicze2S7ex5o7R7yeLaQ",
"prefer_ilm": false,
"ilm_policy": "custom-ilm-override-dsl",
"managed_by": "Data stream lifecycle"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000003",
"index_uuid": "7ufMCy5RTBaxTBJ78dxC-A",
"prefer_ilm": true,
"ilm_policy": "custom-ilm-override-dsl",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 3,
"_meta": {
"description": "Index template for traces-apm-*",
"managed": true
},
"status": "YELLOW",
"template": "traces-apm@template",
"lifecycle": {
"enabled": true,
"data_retention": "10d"
},
"ilm_policy": "custom-ilm-override-dsl",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": true,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": true,
"indices": []
}
}
]
}
@axw this case, as expected, did not work. The reason is that Datastream Lifecycle needs to be explicitly configured for ALREADY created datastreams. So, for any old cluster which has used APM and upgraded to 8.15.1+ would continue to use ILM (even for new indices) unless they explicitly configure DSL using the PUT API. ❌ Tested by updating from 8.14.x to 8.15.1{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "farCK-0lRI-H64IxGfRUuQ",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "C_qI1J2FQ5O-81VuHMl82A",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000003",
"index_uuid": "HVQRbVrtSEm6UmeyPWj8bA",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 3,
"_meta": {
"package": {
"name": "apm"
},
"managed_by": "fleet",
"managed": true
},
"status": "YELLOW",
"template": "traces-apm@template",
"ilm_policy": "traces-apm.traces-default_policy",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": false,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": false,
"indices": []
}
}
]
}
✅ Tested (cluster created locally with 8.14.3 and upgraded to 8.15.1){
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "I5k3QG4QRGGZLdUnNAWpJQ",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "IoauvZ7pQqC-xsRkDTLBkA",
"prefer_ilm": true,
"ilm_policy": "custom-ilmdlm-test",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000003",
"index_uuid": "DDJu8FbnTUCapW6Xr13-Kw",
"prefer_ilm": false,
"ilm_policy": "custom-ilmdlm-test",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 3,
"_meta": {
"package": {
"name": "apm"
},
"managed_by": "fleet",
"managed": true
},
"status": "YELLOW",
"template": "traces-apm@template",
"ilm_policy": "custom-ilmdlm-test",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": false,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": false,
"indices": []
}
}
]
}
✅ Tested by upgrading from 8.14.3 with custom ILM to 8.15.0{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "dFLoaPf3QZC4t7ttplDSqg",
"prefer_ilm": true,
"ilm_policy": "custom-ilmdlm-test",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "fJ__qQv7Tumu9n_j8hEljA",
"prefer_ilm": true,
"ilm_policy": "custom-ilmdlm-test",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000003",
"index_uuid": "kNSWO6pMQ06eZo7yHqKQCw",
"prefer_ilm": true,
"ilm_policy": "custom-ilmdlm-test",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 3,
"_meta": {
"package": {
"name": "apm"
},
"managed_by": "fleet",
"managed": true
},
"status": "YELLOW",
"template": "traces-apm@template",
"ilm_policy": "custom-ilmdlm-test",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": true,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false
}
]
}
This, as expected, creates unmanaged indices. We would need to suggest workaround for this in our changelog/release-notes. The simplest way would be to have users with default ILM settings explicitly configure DSL for all datastreams. Since default ILM and DSL are identical, there would be no impact to the users. In future, if the user wants to move to ILM, they can do so by creating a custom component template. WDYT @axw ?
|
Reading through the test cases, can you clarify if this is true: customers on Please also provide test scenarios where users already have upgraded to |
True, no changes need to be done for this case.
For customers having custom ILM, all would be good. Even for version 8.15.0, they would be in the clear i.e. all their indices would be managed by the configured custom ILM policy (already tested above). However, if a customer with the default ILM policy has moved to 8.15.0 and then upgraded to 8.15.1, then, the indices created in 8.15.0 would be unmanaged even after the upgrade to 8.15.1. Indices created after the upgrade to 8.15.1 would be good though. I was initially thinking of suggesting configuring DSL as when DSL on a datastream is configured then all unmanaged indices are moved to be managed by DSL, however, this would have the side-effect of moving from ILM to DSL. I don't think this should be a big deal as the solution would only be required for installations using the default ILM policies, but, would be good if others could validate this (CC:@Silvia, @axw) ([DONE] PS: I will update the test case comment with the details on 8.15.0 as a step in the upgrade path) |
Test with 8.14.3 -> 8.15.0 -> 8.15.1
json{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "DxvSZVQhQlO-caBMRWQEzQ",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 1,
"failure_indices": [],
"_meta": {
"package": {
"name": "apm"
},
"managed": true,
"managed_by": "fleet"
},
"status": "GREEN",
"template": "traces-apm",
"ilm_policy": "traces-apm.traces-default_policy",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": true,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": false
}
]
}
json{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "DxvSZVQhQlO-caBMRWQEzQ",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "oOlQOsG6RJ6rXbybz-sPtg",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 2,
"failure_indices": [],
"_meta": {
"package": {
"name": "apm"
},
"managed_by": "fleet",
"managed": true
},
"status": "GREEN",
"template": "traces-apm",
"ilm_policy": "traces-apm.traces-default_policy",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": true,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": false
}
]
}
json{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "DxvSZVQhQlO-caBMRWQEzQ",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "oOlQOsG6RJ6rXbybz-sPtg",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 2,
"_meta": {
"package": {
"name": "apm"
},
"managed_by": "fleet",
"managed": true
},
"status": "GREEN",
"template": "traces-apm@template",
"next_generation_managed_by": "Unmanaged",
"prefer_ilm": true,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": false,
"indices": []
}
}
]
}
json{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "DxvSZVQhQlO-caBMRWQEzQ",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "oOlQOsG6RJ6rXbybz-sPtg",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000003",
"index_uuid": "1duuNfCwT6aS_55IEfzMAQ",
"prefer_ilm": true,
"managed_by": "Unmanaged"
}
],
"generation": 3,
"_meta": {
"package": {
"name": "apm"
},
"managed_by": "fleet",
"managed": true
},
"status": "GREEN",
"template": "traces-apm@template",
"next_generation_managed_by": "Unmanaged",
"prefer_ilm": true,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": false,
"indices": []
}
}
]
}
json{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "DxvSZVQhQlO-caBMRWQEzQ",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "oOlQOsG6RJ6rXbybz-sPtg",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000003",
"index_uuid": "1duuNfCwT6aS_55IEfzMAQ",
"prefer_ilm": true,
"managed_by": "Unmanaged"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000004",
"index_uuid": "wVXW11CzTAavehkx1FksLw",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 4,
"_meta": {
"package": {
"name": "apm"
},
"managed_by": "fleet",
"managed": true
},
"status": "GREEN",
"template": "traces-apm@template",
"ilm_policy": "traces-apm.traces-default_policy",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": false,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": false,
"indices": []
}
}
]
}
json{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.02-000001",
"index_uuid": "DxvSZVQhQlO-caBMRWQEzQ",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000002",
"index_uuid": "oOlQOsG6RJ6rXbybz-sPtg",
"prefer_ilm": true,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000003",
"index_uuid": "1duuNfCwT6aS_55IEfzMAQ",
"prefer_ilm": true,
"managed_by": "Unmanaged"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000004",
"index_uuid": "wVXW11CzTAavehkx1FksLw",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
},
{
"index_name": ".ds-traces-apm-default-2024.09.02-000005",
"index_uuid": "UJ8VufpYTgyKa-tXaB4BPA",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 5,
"_meta": {
"package": {
"name": "apm"
},
"managed_by": "fleet",
"managed": true
},
"status": "GREEN",
"template": "traces-apm@template",
"ilm_policy": "traces-apm.traces-default_policy",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": false,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false,
"failure_store": {
"enabled": false,
"rollover_on_write": false,
"indices": []
}
}
]
} |
It's the simplest code change, but I'm not convinced that anyone will go ahead and actively switch their data streams to DSL; I expect we'll end up with users indefinitely sticking with the legacy ILM policies and bifurcating the Serverless & Hosted experience. IMO we should take one of two routes:
I prefer (2) since users will need to start setting |
@lahsivjar it only creates unmanaged indices in |
Yes, this is correct. Only indices created with version 8.15.0 will remain unmanaged. |
Testing with BC
✅ Tested{
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.03-000001",
"index_uuid": "T5YO3keARTqvNSbSOKFuJQ",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Data stream lifecycle"
}
],
"generation": 1,
"_meta": {
"managed": true,
"description": "Index template for traces-apm-*"
},
"status": "YELLOW",
"template": "traces-apm@template",
"lifecycle": {
"enabled": true,
"data_retention": "10d"
},
"ilm_policy": "traces-apm.traces-default_policy",
"next_generation_managed_by": "Data stream lifecycle",
"prefer_ilm": false,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false
}
]
}
✅ Tested (requires to set `"prefer_ilm": true` in the `@custom` component template){
"data_streams": [
{
"name": "traces-apm-default",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-traces-apm-default-2024.09.03-000001",
"index_uuid": "T5YO3keARTqvNSbSOKFuJQ",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Data stream lifecycle"
},
{
"index_name": ".ds-traces-apm-default-2024.09.03-000002",
"index_uuid": "2gyoEUu7TvSdcEQm6NDJUw",
"prefer_ilm": false,
"ilm_policy": "traces-apm.traces-default_policy",
"managed_by": "Data stream lifecycle"
},
{
"index_name": ".ds-traces-apm-default-2024.09.03-000003",
"index_uuid": "qRE3mbVORzKdhJ7Iy9TafQ",
"prefer_ilm": true,
"ilm_policy": "custom-ilmdlm",
"managed_by": "Index Lifecycle Management"
}
],
"generation": 3,
"_meta": {
"managed": true,
"description": "Index template for traces-apm-*"
},
"status": "YELLOW",
"template": "traces-apm@template",
"lifecycle": {
"enabled": true,
"data_retention": "10d"
},
"ilm_policy": "custom-ilmdlm",
"next_generation_managed_by": "Index Lifecycle Management",
"prefer_ilm": true,
"hidden": false,
"system": false,
"allow_custom_routing": false,
"replicated": false,
"rollover_on_write": false
}
]
}
|
APM Server version (
apm-server version
):8.15.0
Description of the problem including expected versus actual behavior: In
8.15.0
we migrated from ILM to DSL. New indexes created for clusters which migrate to8.15.0
don't have any lifecycle attached as existing datastream needs to be updated explicitly: https://www.elastic.co/guide/en/elasticsearch/reference/current/tutorial-manage-existing-data-stream.html.Steps to reproduce:
Please include a minimal but complete recreation of the problem,
including server configuration, agent(s) used, etc. The easier you make it
for us to reproduce it, the more likely that somebody will take the time to
look at it.
8.15.0
8.15.0
Unmanaged
(for example: by usingGET /_data_stream/traces-apm-default
for traces datastream)Unmanaged
(for example: by usingGET /_data_stream/traces-apm-default
for traces datastream)Temporary mitigation is to explicitly set the lifecycle using the PUT API. For example, the below operations would set data retention based on APM defaults for all APM datastreams:
Provide logs (if relevant): N/A
The text was updated successfully, but these errors were encountered: