# Action:ReadOnly appears to set index.blocks.write not index.blocks.read\_only

**URL:** <https://discuss.elastic.co/t/action-readonly-appears-to-set-index-blocks-write-not-index-blocks-read-only/311070>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [August 1, 2022, 1:26am UTC](https://discuss.elastic.co/t/action-readonly-appears-to-set-index-blocks-write-not-index-blocks-read-only/311070 "2022-08-01T01:26:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stef\_Nestor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stef_nestor/32/85483_2.png) [@Stef\_Nestor](https://discuss.elastic.co/u/Stef_Nestor)\
**Post date:** [August 1, 2022, 1:26am UTC](https://discuss.elastic.co/t/action-readonly-appears-to-set-index-blocks-write-not-index-blocks-read-only/311070/1 "2022-08-01T01:26:49Z")

</div>

👋 howdy! I think I'm reading the doc poorly but can't tell intended intended action to request a doc update. Can y'all check this for me, please?

ILM [ReadOnly](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-readonly.html#ilm-read-only-options) states

> Makes the index read-only; writes and metadata changes are no longer allowed.

I (incorrectly?) read this as relating to [Index Block](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-blocks.html#index-block-settings)'s `index.blocks.read_only` stating

> `index.blocks.read_only` Set to true to make the index and index metadata read only, false to allow writes and metadata changes.

However, when I went to test this in v8.3.2 Dev Tools:

```diff
PUT _cluster/settings
{ "transient": { "indices.lifecycle.poll_interval": "30s" }}

PUT _ilm/policy/test_policy
{ "policy": { "phases": {
  "hot": {
    "actions": {
+ "readonly": {},
      "rollover": { "max_docs": 1 }},
    "min_age": "0ms" } } } }

PUT _template/test_template
{ "settings": {
    "index.lifecycle.name": "test_policy",
    "index.lifecycle.rollover_alias": "test_alias"}, 
  "index_patterns": ["test*"] }

PUT test-2022.07.31-000001
{ "aliases": { "test_alias": { "is_write_index": true } } }

POST test_alias/_doc 
{ "data": "value" }

GET test-2022.07.31-000001/_count

```

This soon reported

```diff
GET test-2022.07.31-000001/_ilm/explain
# hot/complete/complete

GET _cat/indices/test*?v&h=health,index,docs.count
# health index docs.count
# yellow test-2022.07.31-000002 0
# yellow test-2022.07.31-000001 2

```

This had the effect:

```diff
# GET test-2022.07.31-000001/_settings
{ "test-2022.07.31-000001": { "settings": { "index": {
  "lifecycle": {
    "name": "test_policy",
    "rollover_alias": "test_alias",
    "indexing_complete": "true"},
  "routing": {"allocation": {"include": {"_tier_preference": "data_content"} } },
  "number_of_shards": "1",
- "blocks": {"write": "true"},
  "provided_name": "test-2022.07.31-000001",
  "creation_date": "1659315269105",
  "number_of_replicas": "1",
  "uuid": "N2nwEMTiSxqBKJePf04hiw",
  "version": {"created": "8030299"} } } } }

```

But no `index.blocks.read_only`. From [Index Blocks](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-blocks.html#index-block-settings), we have settings

> `index.blocks.write` Set to `true` to disable data write operations against the index. Unlike `read_only`, this setting does not affect metadata. For instance, you can adjust the settings of an index with a `write` block, but you cannot adjust the settings of an index with a `read_only` block.

If you repeat the test without `policy.phases.hot.actions.rollover`, the `index.blocks.write` still sets.

Can someone please confirm for me

1. Is ILM [Rollover](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-rollover.html) setting `index.blocks.write:true`? I'm not reading that in the docs, but am also not sure what to expect so may be looking in the wrong place.
2. Is my test faulty? Or is ILM [Read Only](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-readonly.html#ilm-read-only-options) suppose to set `index.blocks.read_only` but is not and this should be filed as a bug in [Github](https://github.com/elastic/elasticsearch/issues/new)? Or is it suppose to setting the `index.blocks.write` instead?

TIA! 🙏

---

<div class="post-metadata">

**Author:** ![Stef\_Nestor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stef_nestor/32/85483_2.png) [@Stef\_Nestor](https://discuss.elastic.co/u/Stef_Nestor)\
**Post date:** [August 2, 2022, 8:30pm UTC](https://discuss.elastic.co/t/action-readonly-appears-to-set-index-blocks-write-not-index-blocks-read-only/311070/2 "2022-08-02T20:30:00Z")

</div>

Led to [elasticsearch#89054](https://github.com/elastic/elasticsearch/pull/89054) which'll resolved doc edit. 🎉

* * *

> If you repeat the test without `policy.phases.hot.actions.rollover`, the `index.blocks.write` still sets.

This was a typo for "without `policy.phases.hot.actions.readonly`" and also appears to have been a testing cache issue. It didn't repeat today after repeating 2d ago 😂

---

<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:** [August 30, 2022, 8:30pm UTC](https://discuss.elastic.co/t/action-readonly-appears-to-set-index-blocks-write-not-index-blocks-read-only/311070/3 "2022-08-30T20:30:20Z")

</div>

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