diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/LifecycleSettings.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/LifecycleSettings.java index 4354c96325e..f865b970339 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/LifecycleSettings.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/LifecycleSettings.java @@ -25,9 +25,8 @@ public class LifecycleSettings { public static final String LIFECYCLE_STEP_INFO = "index.lifecycle.step_info"; public static final String LIFECYCLE_SKIP = "index.lifecycle.skip"; - // NORELEASE: we should probably change the default to something other than three seconds for initial release public static final Setting LIFECYCLE_POLL_INTERVAL_SETTING = Setting.positiveTimeSetting(LIFECYCLE_POLL_INTERVAL, - TimeValue.timeValueSeconds(3), Setting.Property.Dynamic, Setting.Property.NodeScope); + TimeValue.timeValueMinutes(10), Setting.Property.Dynamic, Setting.Property.NodeScope); public static final Setting LIFECYCLE_NAME_SETTING = Setting.simpleString(LIFECYCLE_NAME, Setting.Property.Dynamic, Setting.Property.IndexScope, Setting.Property.InternalIndex); public static final Setting LIFECYCLE_PHASE_SETTING = Setting.simpleString(LIFECYCLE_PHASE, diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleServiceTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleServiceTests.java index 8d3eca2322f..99cfe87ee17 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleServiceTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleServiceTests.java @@ -261,7 +261,7 @@ public class IndexLifecycleServiceTests extends ESTestCase { indexLifecycleService.clusterChanged(noChangeEvent); assertThat(indexLifecycleService.getScheduler().jobCount(), equalTo(1)); assertThat(((TimeValueSchedule) indexLifecycleService.getScheduledJob().getSchedule()).getInterval(), - equalTo(TimeValue.timeValueSeconds(3))); + equalTo(LifecycleSettings.LIFECYCLE_POLL_INTERVAL_SETTING.getDefault(previousState.metaData().settings()))); indexLifecycleService.applyClusterState(event); indexLifecycleService.clusterChanged(event); assertThat(indexLifecycleService.getScheduler().jobCount(), equalTo(1)); diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java index d24e604857c..fce7f0a2479 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java @@ -14,6 +14,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.indexlifecycle.AllocateAction; import org.elasticsearch.xpack.core.indexlifecycle.DeleteAction; @@ -47,9 +48,20 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase { private String policy; @Before - public void refreshIndex() { + public void refreshIndex() throws IOException { index = randomAlphaOfLength(10).toLowerCase(Locale.ROOT); policy = randomAlphaOfLength(5); + Request request = new Request("PUT", "/_cluster/settings"); + XContentBuilder pollIntervalEntity = JsonXContent.contentBuilder(); + pollIntervalEntity.startObject(); + { + pollIntervalEntity.startObject("transient"); + { + pollIntervalEntity.field(LifecycleSettings.LIFECYCLE_POLL_INTERVAL, "1s"); + }pollIntervalEntity.endObject(); + } pollIntervalEntity.endObject(); + request.setJsonEntity(Strings.toString(pollIntervalEntity)); + assertOK(adminClient().performRequest(request)); } public static void updatePolicy(String indexName, String policy) throws IOException {