SyncFlush is only allowed if the engine is not recovery – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.4

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

Briefly, this error occurs when an attempt is made to perform a syncFlush operation while the Elasticsearch engine is in recovery mode. SyncFlush is a process that helps to reduce recovery time when a shard goes inactive. However, it cannot be performed during recovery. To resolve this issue, you can either wait for the recovery process to complete before initiating syncFlush, or you can manually stop the recovery process, perform the syncFlush, and then resume recovery. However, the latter option should be used with caution as it may lead to data loss.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” syncFlush is only allowed if the engine is not recovery ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index, shard, flush, recovery.

Log Context

Log “syncFlush is only allowed if the engine is not recovery” class name is We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 public Engine.SyncedFlushResult syncFlush(String syncId; Engine.CommitId expectedCommitId) {
 logger.trace("trying to sync flush. sync id [{}]. expected commit id [{}]]"; syncId; expectedCommitId);
 Engine engine = getEngine();
 if (engine.isRecovering()) {
 throw new IllegalIndexShardStateException(shardId(); state; "syncFlush is only allowed if the engine is not recovery" +
 " from translog");
 return engine.syncFlush(syncId; expectedCommitId);


How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?