Skip to content

Commit 71b2566

Browse files
Stop trying to upgrade templates and ILM policies after success
After elastic#51456 `IndexTemplateRegistry` is updating tempaltes and ILM policies if necessary. However, even if the upgrade succeeds we keep trying. This commit fixes the issue by setting the `creationCheck` on success.
1 parent 78a1185 commit 71b2566

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ private void putTemplate(final IndexTemplateConfig config, final AtomicBoolean c
168168
new ActionListener<AcknowledgedResponse>() {
169169
@Override
170170
public void onResponse(AcknowledgedResponse response) {
171-
creationCheck.set(false);
171+
creationCheck.set(true);
172172
if (response.isAcknowledged() == false) {
173173
logger.error("error adding index template [{}] for [{}], request was not acknowledged",
174174
templateName, getOrigin());
@@ -222,7 +222,7 @@ private void putPolicy(final LifecyclePolicy policy, final AtomicBoolean creatio
222222
new ActionListener<PutLifecycleAction.Response>() {
223223
@Override
224224
public void onResponse(PutLifecycleAction.Response response) {
225-
creationCheck.set(false);
225+
creationCheck.set(true);
226226
if (response.isAcknowledged() == false) {
227227
logger.error("error adding lifecycle policy [{}] for [{}], request was not acknowledged",
228228
policy.getName(), getOrigin());

0 commit comments

Comments
 (0)