# ILM shrink prevent write on the shrinked index

**URL:** <https://discuss.elastic.co/t/ilm-shrink-prevent-write-on-the-shrinked-index/354848>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [March 6, 2024, 2:16pm UTC](https://discuss.elastic.co/t/ilm-shrink-prevent-write-on-the-shrinked-index/354848 "2024-03-06T14:16:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![voharunado](https://avatars.discourse-cdn.com/v4/letter/v/c0e974/32.png) [@voharunado](https://discuss.elastic.co/u/voharunado)\
**Post date:** [March 6, 2024, 2:16pm UTC](https://discuss.elastic.co/t/ilm-shrink-prevent-write-on-the-shrinked-index/354848/1 "2024-03-06T14:16:18Z")

</div>

I noticed that the Shrink ILM operation makes the source & target index read only, which make sense because that's a requirement for a shrink even if done manually. The issue is that my shrinked index remains read only after the ILM as completed its work.

This is unexpected to me, the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-shrink.html) (and the ILM page on Kibana) does not really mention that. It says "Sets a source index to read-only and shrinks it into a new index with fewer primary shards" but does not indicate that the shrinked index will remain read only. Besided, the shrink operation is only available when moving to the warm phase, which is supposed to still allow for updates (in my case vary rare, but can happen).

So it looks like a bug or missing feature but I would like to be sure before opening an issue.

Here is my policy:

```auto
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "set_priority": {
            "priority": 100
          }
        }
      },
      "warm": {
        "min_age": "60d",
        "actions": {
          "forcemerge": {
            "max_num_segments": 1,
            "index_codec": "best_compression"
          },
          "set_priority": {
            "priority": 50
          },
          "shrink": {
            "max_primary_shard_size": "50gb"
          },
          "allocate": {
            "number_of_replicas": 1
          }
        }
      },
      "cold": {
        "min_age": "740d",
        "actions": {
          "set_priority": {
            "priority": 10
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![voharunado](https://avatars.discourse-cdn.com/v4/letter/v/c0e974/32.png) [@voharunado](https://discuss.elastic.co/u/voharunado)\
**Post date:** [March 13, 2024, 3:18pm UTC](https://discuss.elastic.co/t/ilm-shrink-prevent-write-on-the-shrinked-index/354848/2 "2024-03-13T15:18:01Z")

</div>

Can anyone confirm if this is an issue or not?

I currently do not have a workaround for this except not shrinking. But my hot indices have a lot of shards to support the write load and they don't need that much shards when they go warm. Keeping them will have an impact on the cluster performances at some point I think...  
I don't mind the indices being read\_only during the shrink operation, some writes will fail but as the indices are warm, there is not many writes and they can all be retried later.  
But the indices staying read\_only after the shrink and while they are warm is problematic.

---

<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:** [April 10, 2024, 3:18pm UTC](https://discuss.elastic.co/t/ilm-shrink-prevent-write-on-the-shrinked-index/354848/3 "2024-04-10T15:18:58Z")

</div>

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