30 min timeout for green cluster health

This commit is contained in:
Jörg Prante 2021-04-21 20:13:11 +02:00
parent 2749fe2611
commit f9f62fc56c
3 changed files with 5 additions and 7 deletions

View file

@ -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<String> oldIndex = resolveAlias(index).stream().sorted().findFirst();
Map<String, String> 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

View file

@ -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

View file

@ -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