ES 2.3.3 Force merge not merging?

Hi there,

Was wondering if I could get some clarity on the following issue:

We are using ES 2.3.3, and have some indices that are no longer being written into. We went ahead and executed a force merge on those indices setting the max number of segments to 1. The API returns a success, however nothing happens. Viewing the _cat API we can confirm that the same number of segments exist post the merge.

Is my assumption that segments should equal 1 correct, or am I missing something.

Thanks in advance.

Unfortunately we've seen that force merges can take hours to complete.

There also doesn't appear to be good progress or status tracking of the merge.

I just posted about this here

Another thing to watch out for is that apparently merges are not throttled and can consume many resources on a node which we have seen (ref: https://www.elastic.co/guide/en/elasticsearch/guide/current/merge-process.html#CO41-1)

Ah,

Thanks for the quick response. I did see your post, but didn't put two and two together (thought it was blocking) via the API.

Will check back in a bit on the cluster and see whats up.

Thanks

Hi,

If you want to see if the force merge is running then execute:

GET _nodes/hot_threads

You'll see an output like:

1.0% (4.8ms out of 500ms) cpu usage by thread 'elasticsearch[es2-data1][force_merge][T#1]'
 10/10 snapshots sharing following 18 elements
   java.lang.Object.wait(Native Method)
   org.apache.lucene.index.IndexWriter.doWait(IndexWriter.java:4303)
   org.apache.lucene.index.IndexWriter.forceMerge(IndexWriter.java:1787)

If you don't see this running then its completed.

Would there be any reason a force merge completed, however I have more than one segment?

Don't run a force merge on any index you currently or plan to write to. The index should be effectively "read only". If you run it on an index which your indexing to then its likely you'll end up with more segments.

Mike,

Thanks for the reply. I can confirm I am no longer indexing into the index. I also checked the hot threads and don't ever see a thread for force_merge. The fact that I do not have a single segment is still a bit head scratching.

Hi,

Make sure you use:

POST /twitter/_forcemerge?max_num_segments=1

1 Like

I'm seeing the same behavior on 5.0.1. Despite setting max_num_segments=1 I end up with two segments.

How many shards in the index? It will merge the max_num per shard.

Update:
Thanks Mike, the issue was max_num_segments as a url param as opposed to a body param, which was using the default (bit misleading)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.