Best effort force merge to segments did not succeed for shards – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7-7.15

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 Elasticsearch attempts to force merge indices to reduce the number of segments, but fails. This could be due to insufficient disk space, high cluster load, or a network issue. To resolve this, you can try freeing up disk space, reducing the load on your cluster by optimizing your queries or increasing your cluster’s capacity. Also, ensure your network connectivity is stable. If the issue persists, consider reindexing your data or increasing the timeout value for the force merge operation.

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 ” [{}] best effort force merge to [{}] segments did not succeed for {} shards: {} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: merge, plugin.

Log Context

Log “[{}] best effort force merge to [{}] segments did not succeed for {} shards: {}” classname is
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                        .filter(shardSegments -> shardSegments.getSegments().size() > maxNumSegments)
                    if (unmergedShards.size() > 0) {
                        Map unmergedShardCounts =
                            .collect(Collectors.toMap(ShardSegments::getShardRouting; ss -> ss.getSegments().size()));
              "[{}] best effort force merge to [{}] segments did not succeed for {} shards: {}";
                            index.getName(); maxNumSegments; unmergedShards.size(); unmergedShardCounts);
                    // Force merging is best effort; so always return true that the condition has been met.
                    listener.onResponse(true; new Info(unmergedShards.size()));


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?