|
@@ -165,18 +165,15 @@ public class DataStreamAndIndexLifecycleMixingTests extends ESIntegTestCase {
|
|
|
|
|
|
// let's update the index template to remove the ILM configuration and configured data stream lifecycle
|
|
|
// note that this index template change will NOT configure a data stream lifecycle on the data stream, only for **new** data streams
|
|
|
-
|
|
|
// All existing data streams will fallback to their default data stream lifecycle
|
|
|
-
|
|
|
- // we'll rollover the data stream by indexing 2 documents (like ILM expects) and assert that the rollover happens once so the
|
|
|
- // data stream has 3 backing indices, two managed by ILM and one will be managed by the data stream lifecycle
|
|
|
DataStreamLifecycle.Template customLifecycle = DataStreamLifecycle.dataLifecycleBuilder()
|
|
|
- .dataRetention(randomPositiveTimeValue())
|
|
|
+ .dataRetention(randomTimeValueGreaterThan(TimeValue.timeValueSeconds(10)))
|
|
|
.buildTemplate();
|
|
|
putComposableIndexTemplate(indexTemplateName, null, List.of(dataStreamName + "*"), Settings.EMPTY, null, customLifecycle);
|
|
|
|
|
|
+ // we'll rollover the data stream by indexing 2 documents (like ILM expects) and assert that the rollover happens once so the
|
|
|
+ // data stream has 3 backing indices, two managed by ILM and one will be managed by the data stream lifecycle
|
|
|
indexDocs(dataStreamName, 2);
|
|
|
-
|
|
|
// data stream was rolled over and has 3 indices, two managed by ILM and the write index will be unmanaged
|
|
|
assertBusy(() -> {
|
|
|
GetDataStreamAction.Request getDataStreamRequest = new GetDataStreamAction.Request(
|
|
@@ -561,11 +558,8 @@ public class DataStreamAndIndexLifecycleMixingTests extends ESIntegTestCase {
|
|
|
|
|
|
// let's update the index template to configure the management preference to be data stream lifecycle using the prefer_ilm setting
|
|
|
// note that this index template change will NOT affect existing indices but only the new ones after a rollover.
|
|
|
-
|
|
|
- // we'll rollover the data stream by indexing 2 documents (like ILM expects) and assert that the rollover happens once so the
|
|
|
- // data stream has 3 backing indices, 2 managed by ILM and 1 by the default data stream lifecycle
|
|
|
DataStreamLifecycle.Template customLifecycle = DataStreamLifecycle.dataLifecycleBuilder()
|
|
|
- .dataRetention(randomPositiveTimeValue())
|
|
|
+ .dataRetention(randomTimeValueGreaterThan(TimeValue.timeValueSeconds(10)))
|
|
|
.buildTemplate();
|
|
|
putComposableIndexTemplate(
|
|
|
indexTemplateName,
|
|
@@ -576,6 +570,8 @@ public class DataStreamAndIndexLifecycleMixingTests extends ESIntegTestCase {
|
|
|
customLifecycle
|
|
|
);
|
|
|
|
|
|
+ // we'll rollover the data stream by indexing 2 documents (like ILM expects) and assert that the rollover happens once so the
|
|
|
+ // data stream has 3 backing indices, 2 managed by ILM and 1 by the default data stream lifecycle
|
|
|
indexDocs(dataStreamName, 2);
|
|
|
|
|
|
assertBusy(() -> {
|