# Segments with 60-70% deleted docs (5G) never remove deleted docs

**URL:** <https://discuss.elastic.co/t/segments-with-60-70-deleted-docs-5g-never-remove-deleted-docs/238342>\
**Category:** Elasticsearch\
**Created:** [June 23, 2020, 8:56pm UTC](https://discuss.elastic.co/t/segments-with-60-70-deleted-docs-5g-never-remove-deleted-docs/238342 "2020-06-23T20:56:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zenloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zenloop/32/71314_2.png) [@zenloop](https://discuss.elastic.co/u/zenloop)\
**Post date:** [June 23, 2020, 8:56pm UTC](https://discuss.elastic.co/t/segments-with-60-70-deleted-docs-5g-never-remove-deleted-docs/238342/1 "2020-06-23T20:56:57Z")

</div>

Will a 5g segment ever be selected for merging? We have 5g segments with up to 60-70% deleted docs. We have been monitoring and the segments never appear to be selected for merge.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 23, 2020, 11:02pm UTC](https://discuss.elastic.co/t/segments-with-60-70-deleted-docs-5g-never-remove-deleted-docs/238342/2 "2020-06-23T23:02:37Z")

</div>

Any segment should be a potential for merging. Have you tried a force merge?

---

<div class="post-metadata">

**Author:** ![zenloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zenloop/32/71314_2.png) [@zenloop](https://discuss.elastic.co/u/zenloop)\
**Post date:** [June 29, 2020, 6:39pm UTC](https://discuss.elastic.co/t/segments-with-60-70-deleted-docs-5g-never-remove-deleted-docs/238342/3 "2020-06-29T18:39:36Z")

</div>

The issue we were having with force merge was that we were ending up with very large segment sizes (30G). This would cause issues with rebalancing as the shards would bounce around looking for a node to land on. The command run was: `_forcemerge?only_expunge_deletes=true`. Are there additional flags that should be used to limit the segment size to 5g? Thanks much.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 27, 2020, 6:39pm UTC](https://discuss.elastic.co/t/segments-with-60-70-deleted-docs-5g-never-remove-deleted-docs/238342/4 "2020-07-27T18:39:37Z")

</div>

Closed on July 27, 2020, 6:39pm UTC

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