mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Adding prefer_ilm as a whitelisted data stream setting (#128375)
This commit is contained in:
parent
8484b71126
commit
41f186dca0
2 changed files with 11 additions and 3 deletions
|
@ -33,6 +33,7 @@ import org.elasticsearch.common.settings.SettingsFilter;
|
|||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.Index;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
import org.elasticsearch.indices.SystemIndices;
|
||||
import org.elasticsearch.injection.guice.Inject;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
|
@ -53,7 +54,7 @@ public class TransportUpdateDataStreamSettingsAction extends TransportMasterNode
|
|||
UpdateDataStreamSettingsAction.Request,
|
||||
UpdateDataStreamSettingsAction.Response> {
|
||||
private static final Logger logger = LogManager.getLogger(TransportUpdateDataStreamSettingsAction.class);
|
||||
private static final Set<String> APPLY_TO_BACKING_INDICES = Set.of("index.lifecycle.name");
|
||||
private static final Set<String> APPLY_TO_BACKING_INDICES = Set.of("index.lifecycle.name", IndexSettings.PREFER_ILM);
|
||||
private static final Set<String> APPLY_TO_DATA_STREAM_ONLY = Set.of("index.number_of_shards");
|
||||
private final MetadataDataStreamsService metadataDataStreamsService;
|
||||
private final MetadataUpdateSettingsService updateSettingsService;
|
||||
|
|
|
@ -51,16 +51,20 @@ setup:
|
|||
body:
|
||||
index:
|
||||
number_of_shards: 2
|
||||
lifecycle.name: my-new-policy
|
||||
lifecycle:
|
||||
name: my-new-policy
|
||||
prefer_ilm: true
|
||||
- match: { data_streams.0.name: my-data-stream-1 }
|
||||
- match: { data_streams.0.applied_to_data_stream: true }
|
||||
- match: { data_streams.0.index_settings_results.applied_to_data_stream_only: [index.number_of_shards]}
|
||||
- match: { data_streams.0.index_settings_results.applied_to_data_stream_and_backing_indices: [index.lifecycle.name] }
|
||||
- length: { data_streams.0.index_settings_results.applied_to_data_stream_and_backing_indices: 2 }
|
||||
- match: { data_streams.0.settings.index.number_of_shards: "2" }
|
||||
- match: { data_streams.0.settings.index.lifecycle.name: "my-new-policy" }
|
||||
- match: { data_streams.0.settings.index.lifecycle.prefer_ilm: "true" }
|
||||
- match: { data_streams.0.effective_settings.index.number_of_shards: "2" }
|
||||
- match: { data_streams.0.effective_settings.index.number_of_replicas: "0" }
|
||||
- match: { data_streams.0.effective_settings.index.lifecycle.name: "my-new-policy" }
|
||||
- match: { data_streams.0.effective_settings.index.lifecycle.prefer_ilm: "true" }
|
||||
|
||||
- do:
|
||||
indices.rollover:
|
||||
|
@ -79,6 +83,7 @@ setup:
|
|||
- match: { data_streams.0.effective_settings.index.number_of_shards: "2" }
|
||||
- match: { data_streams.0.effective_settings.index.number_of_replicas: "0" }
|
||||
- match: { data_streams.0.effective_settings.index.lifecycle.name: "my-new-policy" }
|
||||
- match: { data_streams.0.effective_settings.index.lifecycle.prefer_ilm: "true" }
|
||||
|
||||
- do:
|
||||
indices.get_data_stream:
|
||||
|
@ -86,6 +91,7 @@ setup:
|
|||
- match: { data_streams.0.name: my-data-stream-1 }
|
||||
- match: { data_streams.0.settings.index.number_of_shards: "2" }
|
||||
- match: { data_streams.0.settings.index.lifecycle.name: "my-new-policy" }
|
||||
- match: { data_streams.0.settings.index.lifecycle.prefer_ilm: "true" }
|
||||
- match: { data_streams.0.effective_settings: null }
|
||||
|
||||
- do:
|
||||
|
@ -101,6 +107,7 @@ setup:
|
|||
- match: { .$idx0name.settings.index.lifecycle.name: "my-new-policy" }
|
||||
- match: { .$idx1name.settings.index.number_of_shards: "2" }
|
||||
- match: { .$idx1name.settings.index.lifecycle.name: "my-new-policy" }
|
||||
- match: { .$idx1name.settings.index.lifecycle.prefer_ilm: "true" }
|
||||
|
||||
---
|
||||
"Test multiple data streams":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue