i have a live index with a lot of updates that runs out of disk space at some time.
The reason is that after some time i have a lot of max size segments (5gb) but the deleted document count is below 50% → The normal merge will not touch them.
My idea is: Can i rewrite the current segments without the deleted documents to give disk space free.
Can a forcemerge with “only_expunge_deletes=true” do the trick for me? Or will this create big segments that create more problems in the future?
Segments in Elsticsearch are immutable so no matter how you run forcemerge new segments will be created. Even if new segments are created it may be beneficial to run forcemerge the way you described, but be aware it will temporarily increase disk usage. I do not know the internals though and have rarely tried to tune merging so will need to leave that to someone else.
I have a live Elasticsearch index with heavy updates, and over time it starts running out of disk space. Many segments are already at max size (~5GB), but their deleted doc ratio is still below 50%, so normal merges don’t seem to clean them up.
I’m wondering if running forcemerge with only_expunge_deletes=true can help reclaim disk space by removing deleted documents without doing a full reindex.
Does this option simply rewrite existing segments to drop deletes, or can it create large segments that might cause problems later? Any practical guidance or caveats for using this on a live index would be helpful.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.