diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/translog/TranslogService.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/translog/TranslogService.java index a40557d3505..d0d6d8e0345 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/translog/TranslogService.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/translog/TranslogService.java @@ -116,7 +116,9 @@ public class TranslogService extends AbstractIndexShardComponent { threadPool.executor(ThreadPool.Names.MANAGEMENT).execute(new Runnable() { @Override public void run() { try { - indexShard.flush(new Engine.Flush()); + if (indexShard.state() == IndexShardState.STARTED) { + indexShard.flush(new Engine.Flush()); + } } catch (EngineClosedException e) { // we are being closed, ignore } catch (FlushNotAllowedEngineException e) {