From f9f62fc56ce7a498a0187fa8baeae0046df98998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Wed, 21 Apr 2021 20:13:11 +0200 Subject: [PATCH] 30 min timeout for green cluster health --- .../main/java/org/xbib/elx/common/AbstractAdminClient.java | 7 +++---- .../main/java/org/xbib/elx/common/AbstractBulkClient.java | 3 +-- gradle.properties | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java index 203fdb2..8ad0db5 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java @@ -112,7 +112,7 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements } DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest().indices(index); client.execute(DeleteIndexAction.INSTANCE, deleteIndexRequest).actionGet(); - waitForCluster("YELLOW", 30L, TimeUnit.SECONDS); + waitForCluster("GREEN", 30L, TimeUnit.MINUTES); return this; } @@ -229,7 +229,6 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements if (index.equals(fullIndexName)) { return new EmptyIndexShiftResult(); // nothing to shift to } - waitForCluster("YELLOW", 30L, TimeUnit.SECONDS); // two situations: 1. a new alias 2. there is already an old index with the alias Optional oldIndex = resolveAlias(index).stream().sorted().findFirst(); Map oldAliasMap = oldIndex.map(this::getAliases).orElse(null); @@ -410,7 +409,7 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements if (forceMergeResponse.getFailedShards() > 0) { throw new IllegalStateException("failed shards after force merge: " + forceMergeResponse.getFailedShards()); } - waitForCluster("GREEN", 300L, TimeUnit.SECONDS); + waitForCluster("GREEN", 30L, TimeUnit.MINUTES); return true; } @@ -422,7 +421,7 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(index) .settings(updateSettingsBuilder).timeout(toTimeValue(timeout, timeUnit)); client.execute(UpdateSettingsAction.INSTANCE, updateSettingsRequest).actionGet(); - waitForCluster("GREEN", 300L, TimeUnit.SECONDS); + waitForCluster("GREEN", 30L, TimeUnit.MINUTES); } @Override diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java index 55ad8f8..14c6ffc 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java @@ -114,8 +114,7 @@ public abstract class AbstractBulkClient extends AbstractBasicClient implements logger.warn("index creation of {} not acknowledged", index); return; } - // we really need state GREEN. If yellow, we may trigger shard write errors and queue will exceed quickly. - waitForCluster("GREEN", 300L, TimeUnit.SECONDS); + waitForCluster("GREEN", 30L, TimeUnit.MINUTES); } @Override diff --git a/gradle.properties b/gradle.properties index d58c194..78d430f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group = org.xbib name = elx -version = 2.2.1.43 +version = 2.2.1.44 gradle.wrapper.version = 6.6.1 xbib-metrics.version = 2.1.0