From 09cdc1c3798508b81b43c4825fe02395b4b2438b Mon Sep 17 00:00:00 2001 From: kimchy Date: Wed, 15 Sep 2010 18:22:13 +0200 Subject: [PATCH] don't wait for indices if there are none when using local gateway --- .../java/org/elasticsearch/gateway/local/LocalGateway.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/gateway/local/LocalGateway.java b/modules/elasticsearch/src/main/java/org/elasticsearch/gateway/local/LocalGateway.java index bb4f8d154e8..9db2dfc7ac7 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/gateway/local/LocalGateway.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/gateway/local/LocalGateway.java @@ -143,6 +143,12 @@ public class LocalGateway extends AbstractLifecycleComponent implements listener.onSuccess(); return; } + if (electedState.state().metaData().indices().isEmpty()) { + logger.debug("no indices in metadata"); + listener.onSuccess(); + return; + } + logger.debug("elected state from [{}]", electedState.node()); final LocalGatewayMetaState state = electedState.state(); final AtomicInteger indicesCounter = new AtomicInteger(state.metaData().indices().size());