Minimum lifecycles for time series data stream
When you create a time series data stream (TSDS) without a data stream lifecycle, Elasticsearch adds a minimum lifecycle. A minimum lifecycle performs only the operations a data stream needs to stay healthy: rollover and tail merging.
- To change
data_streams.lifecycle.minimum.enabled, you need themanagecluster privilege. - To check whether a minimum lifecycle manages a stream, you need the
view_index_metadataindices privilege. - To change a lifecycle, you need
manage_data_stream_lifecycleindices privilege.
A minimum lifecycle applies in the following conditions:
- The data stream is a TSDS.
- The data stream does not have a data stream lifecycle configured.
- The
data_streams.lifecycle.minimum.enabledcluster setting istrue. - Backing indices are not managed by ILM policies.
A backing index with an ILM policy stays managed by ILM unless
index.lifecycle.prefer_ilmisfalse.
A minimum lifecycle includes the following operations:
- The data stream backing indices are rolled over whenever they grow beyond the size, age, or number of documents defined in
cluster.lifecycle.default.rollover. - After a roll over, a tail merge operation occurs to improve the storage footprint and search performance on the most recent rolled-over data.
For more information about these operations, refer to Data stream lifecycle in Elasticsearch > How does it work?.
The minimum lifecycle doesn't provide downsampling, move data to searchable snapshots, or delete data (even if you configure global retention settings such as data_streams.lifecycle.retention.default and data_streams.lifecycle.retention.max).
To turn on those features, you can configure your own lifecycle.
Refer to Update the lifecycle of a data stream.
A data stream with a lifecycle that is explicitly turned off keeps that configuration and the minimum lifecycle does not apply.
To check whether a data stream or an index is managed by a minimum lifecycle, use the following APIs:
- Get data stream API: returns
"minimum_lifecycle_enabled": trueand"next_generation_managed_by": "Data stream lifecycle"for the data stream. - Get data stream lifecycle API: returns
"minimum_lifecycle_enabled": truefor the data stream. - Explain data stream lifecycle API: returns
"minimum_lifecycle_enabled": truefor each index the minimum lifecycle manages. For indices that no lifecycle manages, the response includes anunmanaged_reasonfield when Elasticsearch can determine why. The ILM explain API includes the same field.
Before 9.6, a TSDS without a lifecycle or an ILM policy was never rolled over automatically. If an external process rolls over your TSDS, you might now see additional backing indices.
If your TSDS has an ILM policy, no data stream lifecycle, and index.lifecycle.prefer_ilm is set to false, it moves from ILM to the minimum lifecycle.
As a result, ILM phases such as delete or downsample stop running for it.
To restore the previous behavior, set data_streams.lifecycle.minimum.enabled to false.
The setting is dynamic, so you don't need to restart Elasticsearch.
For example:
PUT _cluster/settings
{
"persistent": {
"data_streams.lifecycle.minimum.enabled": false
}
}