# Accepting late events after force-merge

**URL:** <https://discuss.elastic.co/t/accepting-late-events-after-force-merge/203034>\
**Category:** Elasticsearch\
**Created:** [October 10, 2019, 1:38pm UTC](https://discuss.elastic.co/t/accepting-late-events-after-force-merge/203034 "2019-10-10T13:38:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitavmohanty01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amitavmohanty01/32/58017_2.png) [@amitavmohanty01](https://discuss.elastic.co/u/amitavmohanty01)\
**Post date:** [October 10, 2019, 1:38pm UTC](https://discuss.elastic.co/t/accepting-late-events-after-force-merge/203034/1 "2019-10-10T13:38:34Z")

</div>

As mentioned in [docs](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/_actions.html#ilm-forcemerge-action), when we define `force-merge` as part of an ILM policy, it also makes the index read-only. I want to `force-merge` an index to compact it and get some size benefit but I don't want to make it `read-only`. I want to continue accepting late events after the index has been compacted. Should I manually remove the `read-only` status for the indices after segment merging is complete ?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 10, 2019, 1:46pm UTC](https://discuss.elastic.co/t/accepting-late-events-after-force-merge/203034/2 "2019-10-10T13:46:29Z")

</div>

No, you should not write to an index after it has been force-merged. From [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html):

> **WARNING** : **Force merge should only be called against an index after you have finished writing to it.** Force merge can cause very large (\>5GB) segments to be produced, and if you continue to write to such an index then the automatic merge policy will never consider these segments for future merges until they mostly consist of deleted documents. This can cause very large segments to remain in the index which can result in increased disk usage and worse search performance.

---

<div class="post-metadata">

**Author:** ![amitavmohanty01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amitavmohanty01/32/58017_2.png) [@amitavmohanty01](https://discuss.elastic.co/u/amitavmohanty01)\
**Post date:** [October 10, 2019, 3:56pm UTC](https://discuss.elastic.co/t/accepting-late-events-after-force-merge/203034/3 "2019-10-10T15:56:36Z")

</div>

Thank you for the explanation and the reference @DavidTurner. I should have seen that doc.

**Pure speculation ahead**  
I wonder if there is any compaction option which reduces a bit of disk footprint but does not do it till the extent of creating huge segments as `force-merge` does. What I am trying to say is `force-merge` creates segments which at one end of optimization. Regular indices would be unoptimized. I am thinking is there any operation that optimizes the index a bit but not completely.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 10, 2019, 4:41pm UTC](https://discuss.elastic.co/t/accepting-late-events-after-force-merge/203034/4 "2019-10-10T16:41:29Z")

</div>

> [@amitavmohanty01](#):
>
> I am thinking is there any operation that optimizes the index a bit but not completely.

This is what the usual (automatic) background merge process does.

---

<div class="post-metadata">

**Author:** ![amitavmohanty01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amitavmohanty01/32/58017_2.png) [@amitavmohanty01](https://discuss.elastic.co/u/amitavmohanty01)\
**Post date:** [October 10, 2019, 6:02pm UTC](https://discuss.elastic.co/t/accepting-late-events-after-force-merge/203034/5 "2019-10-10T18:02:01Z")

</div>

Great. Thanks for clarifying.

---

<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:** [November 7, 2019, 6:02pm UTC](https://discuss.elastic.co/t/accepting-late-events-after-force-merge/203034/6 "2019-11-07T18:02:11Z")

</div>

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