diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java index ecec5991ade39..b698143f6ca4c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java @@ -814,6 +814,7 @@ public void onFailure(Exception e) { templateName ); RolloverRequest request = new RolloverRequest(rolloverTarget, null); + request.lazy(true); request.masterNodeTimeout(TimeValue.timeValueMinutes(1)); executeAsyncWithOrigin( client.threadPool().getThreadContext(), diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistryTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistryTests.java index 2b845affde63b..b0127c0005323 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistryTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistryTests.java @@ -377,6 +377,7 @@ public void testAutomaticRollover() throws Exception { rolloverCounter.incrementAndGet(); RolloverRequest rolloverRequest = ((RolloverRequest) request); assertThat(rolloverRequest.getRolloverTarget(), startsWith("logs-my_app-")); + assertThat(rolloverRequest.isLazy(), equalTo(true)); } else if (action == TransportPutComposableIndexTemplateAction.TYPE) { putIndexTemplateCounter.incrementAndGet(); }