diff --git a/src/main/java/org/elasticsearch/gateway/GatewayService.java b/src/main/java/org/elasticsearch/gateway/GatewayService.java index 827a6559bf9..b5468aaf29e 100644 --- a/src/main/java/org/elasticsearch/gateway/GatewayService.java +++ b/src/main/java/org/elasticsearch/gateway/GatewayService.java @@ -104,6 +104,7 @@ public class GatewayService extends AbstractLifecycleComponent i @Override protected void doStart() throws ElasticsearchException { gateway.start(); + clusterService.addLast(this); // if we received initial state, see if we can recover within the start phase, so we hold the // node from starting until we recovered properly if (discoveryService.initialStateReceived()) { @@ -114,7 +115,6 @@ public class GatewayService extends AbstractLifecycleComponent i } else { logger.debug("can't wait on start for (possibly) reading state from gateway, will do it asynchronously"); } - clusterService.addLast(this); } @Override