30 min timeout for green cluster health

2.2.1.44
Jörg Prante 3 years ago
parent 2749fe2611
commit f9f62fc56c

@ -112,7 +112,7 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements
} }
DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest().indices(index); DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest().indices(index);
client.execute(DeleteIndexAction.INSTANCE, deleteIndexRequest).actionGet(); client.execute(DeleteIndexAction.INSTANCE, deleteIndexRequest).actionGet();
waitForCluster("YELLOW", 30L, TimeUnit.SECONDS); waitForCluster("GREEN", 30L, TimeUnit.MINUTES);
return this; return this;
} }
@ -229,7 +229,6 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements
if (index.equals(fullIndexName)) { if (index.equals(fullIndexName)) {
return new EmptyIndexShiftResult(); // nothing to shift to 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 // two situations: 1. a new alias 2. there is already an old index with the alias
Optional<String> oldIndex = resolveAlias(index).stream().sorted().findFirst(); Optional<String> oldIndex = resolveAlias(index).stream().sorted().findFirst();
Map<String, String> oldAliasMap = oldIndex.map(this::getAliases).orElse(null); 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) { if (forceMergeResponse.getFailedShards() > 0) {
throw new IllegalStateException("failed shards after force merge: " + forceMergeResponse.getFailedShards()); throw new IllegalStateException("failed shards after force merge: " + forceMergeResponse.getFailedShards());
} }
waitForCluster("GREEN", 300L, TimeUnit.SECONDS); waitForCluster("GREEN", 30L, TimeUnit.MINUTES);
return true; return true;
} }
@ -422,7 +421,7 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements
UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(index) UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(index)
.settings(updateSettingsBuilder).timeout(toTimeValue(timeout, timeUnit)); .settings(updateSettingsBuilder).timeout(toTimeValue(timeout, timeUnit));
client.execute(UpdateSettingsAction.INSTANCE, updateSettingsRequest).actionGet(); client.execute(UpdateSettingsAction.INSTANCE, updateSettingsRequest).actionGet();
waitForCluster("GREEN", 300L, TimeUnit.SECONDS); waitForCluster("GREEN", 30L, TimeUnit.MINUTES);
} }
@Override @Override

@ -114,8 +114,7 @@ public abstract class AbstractBulkClient extends AbstractBasicClient implements
logger.warn("index creation of {} not acknowledged", index); logger.warn("index creation of {} not acknowledged", index);
return; return;
} }
// we really need state GREEN. If yellow, we may trigger shard write errors and queue will exceed quickly. waitForCluster("GREEN", 30L, TimeUnit.MINUTES);
waitForCluster("GREEN", 300L, TimeUnit.SECONDS);
} }
@Override @Override

@ -1,6 +1,6 @@
group = org.xbib group = org.xbib
name = elx name = elx
version = 2.2.1.43 version = 2.2.1.44
gradle.wrapper.version = 6.6.1 gradle.wrapper.version = 6.6.1
xbib-metrics.version = 2.1.0 xbib-metrics.version = 2.1.0

Loading…
Cancel
Save