# Changing index settings when closed can corrupt an index

**URL:** <https://discuss.elastic.co/t/changing-index-settings-when-closed-can-corrupt-an-index/326705>\
**Category:** Elasticsearch\
**Created:** [February 28, 2023, 7:19pm UTC](https://discuss.elastic.co/t/changing-index-settings-when-closed-can-corrupt-an-index/326705 "2023-02-28T19:19:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwilches](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dwilches/32/48586_2.png) [@dwilches](https://discuss.elastic.co/u/dwilches)\
**Post date:** [February 28, 2023, 7:19pm UTC](https://discuss.elastic.co/t/changing-index-settings-when-closed-can-corrupt-an-index/326705/1 "2023-02-28T19:19:18Z")

</div>

I found a warning in this documentation page about updating index settings while they are closed:

> Changing static or dynamic index settings on a closed index could result in incorrect settings that are impossible to rectify without deleting and recreating the index.

Source: [Index modules | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/index-modules.html)

Does this refer to any setting? If so, why is updating the settings allowed on a closed index?

What I want to achieve is to update the `index.codec` setting, which can't be done while the index is open or I would get:

> Can't update non dynamic settings [[index.codec]] for open indices ...

So I was considering closing the index before doing the update, but then it seems there is no guarantee my index can be reopened later?

ES version: 7.17, but the warning is also in the 8.x docs.

---

<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:** [February 28, 2023, 8:07pm UTC](https://discuss.elastic.co/t/changing-index-settings-when-closed-can-corrupt-an-index/326705/2 "2023-02-28T20:07:22Z")

</div>

You will be safe changing that setting, as you point out, it needs to be closed to changed it.

---

<div class="post-metadata">

**Author:** ![dwilches](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dwilches/32/48586_2.png) [@dwilches](https://discuss.elastic.co/u/dwilches)\
**Post date:** [February 28, 2023, 8:13pm UTC](https://discuss.elastic.co/t/changing-index-settings-when-closed-can-corrupt-an-index/326705/4 "2023-02-28T20:13:07Z")

</div>

@warkolm Do you know of a list of settings we can safely change while the index is closed which confirms `index.codec` is safe to change?  
I would like to have confirmation in the docs as otherwise this could change in a future version of ES and the release notes wouldn't point that out as a breaking change.

---

<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:** [March 28, 2023, 8:13pm UTC](https://discuss.elastic.co/t/changing-index-settings-when-closed-can-corrupt-an-index/326705/5 "2023-03-28T20:13:35Z")

</div>

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