Skip to content

Commit e49a5e8

Browse files
authored
Adding index.refresh_interval as a data stream setting (#131482)
1 parent 161dd69 commit e49a5e8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportUpdateDataStreamSettingsAction.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ public class TransportUpdateDataStreamSettingsAction extends TransportMasterNode
5454
UpdateDataStreamSettingsAction.Request,
5555
UpdateDataStreamSettingsAction.Response> {
5656
private static final Logger logger = LogManager.getLogger(TransportUpdateDataStreamSettingsAction.class);
57-
private static final Set<String> APPLY_TO_BACKING_INDICES = Set.of("index.lifecycle.name", IndexSettings.PREFER_ILM);
57+
private static final Set<String> APPLY_TO_BACKING_INDICES = Set.of(
58+
"index.lifecycle.name",
59+
IndexSettings.PREFER_ILM,
60+
"index.refresh_interval"
61+
);
5862
private static final Set<String> APPLY_TO_DATA_STREAM_ONLY = Set.of("index.number_of_shards");
5963
private final MetadataDataStreamsService metadataDataStreamsService;
6064
private final MetadataUpdateSettingsService updateSettingsService;

modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/240_data_stream_settings.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,21 @@ setup:
5151
body:
5252
index:
5353
number_of_shards: 2
54+
refresh_interval: 29s
5455
lifecycle:
5556
name: my-new-policy
5657
prefer_ilm: true
5758
- match: { data_streams.0.name: my-data-stream-1 }
5859
- match: { data_streams.0.applied_to_data_stream: true }
5960
- match: { data_streams.0.index_settings_results.applied_to_data_stream_only: [index.number_of_shards]}
60-
- length: { data_streams.0.index_settings_results.applied_to_data_stream_and_backing_indices: 2 }
61+
- length: { data_streams.0.index_settings_results.applied_to_data_stream_and_backing_indices: 3 }
6162
- match: { data_streams.0.settings.index.number_of_shards: "2" }
63+
- match: { data_streams.0.settings.index.refresh_interval: "29s" }
6264
- match: { data_streams.0.settings.index.lifecycle.name: "my-new-policy" }
6365
- match: { data_streams.0.settings.index.lifecycle.prefer_ilm: "true" }
6466
- match: { data_streams.0.effective_settings.index.number_of_shards: "2" }
6567
- match: { data_streams.0.effective_settings.index.number_of_replicas: "0" }
68+
- match: { data_streams.0.effective_settings.index.refresh_interval: "29s" }
6669
- match: { data_streams.0.effective_settings.index.lifecycle.name: "my-new-policy" }
6770
- match: { data_streams.0.effective_settings.index.lifecycle.prefer_ilm: "true" }
6871

@@ -81,6 +84,7 @@ setup:
8184
- match: { data_streams.0.name: my-data-stream-1 }
8285
- match: { data_streams.0.settings.index.number_of_shards: "2" }
8386
- match: { data_streams.0.effective_settings.index.number_of_shards: "2" }
87+
- match: { data_streams.0.effective_settings.index.refresh_interval: "29s" }
8488
- match: { data_streams.0.effective_settings.index.number_of_replicas: "0" }
8589
- match: { data_streams.0.effective_settings.index.lifecycle.name: "my-new-policy" }
8690
- match: { data_streams.0.effective_settings.index.lifecycle.prefer_ilm: "true" }
@@ -90,6 +94,7 @@ setup:
9094
name: my-data-stream-1
9195
- match: { data_streams.0.name: my-data-stream-1 }
9296
- match: { data_streams.0.settings.index.number_of_shards: "2" }
97+
- match: { data_streams.0.settings.index.refresh_interval: "29s" }
9398
- match: { data_streams.0.settings.index.lifecycle.name: "my-new-policy" }
9499
- match: { data_streams.0.settings.index.lifecycle.prefer_ilm: "true" }
95100
- match: { data_streams.0.effective_settings: null }
@@ -106,6 +111,7 @@ setup:
106111
- match: { .$idx0name.settings.index.number_of_shards: "1" }
107112
- match: { .$idx0name.settings.index.lifecycle.name: "my-new-policy" }
108113
- match: { .$idx1name.settings.index.number_of_shards: "2" }
114+
- match: { .$idx1name.settings.index.refresh_interval: "29s" }
109115
- match: { .$idx1name.settings.index.lifecycle.name: "my-new-policy" }
110116
- match: { .$idx1name.settings.index.lifecycle.prefer_ilm: "true" }
111117

0 commit comments

Comments
 (0)