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

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.

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 SegmentCountStep.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                        .filter(shardSegments -> shardSegments.getSegments().size() > maxNumSegments)
                        .collect(Collectors.toList());
                    if (unmergedShards.size() > 0) {
                        Map unmergedShardCounts = unmergedShards.stream()
                            .collect(Collectors.toMap(ShardSegments::getShardRouting; ss -> ss.getSegments().size()));
                        logger.info("[{}] 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?