Action:ReadOnly appears to set index.blocks.write not index.blocks.read_only

:wave: 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 states

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

I (incorrectly?) read this as relating to Index Block'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:

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

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:

# 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, 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 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 suppose to set index.blocks.read_only but is not and this should be filed as a bug in Github? Or is it suppose to setting the index.blocks.write instead?

TIA! :pray:

Led to elasticsearch#89054 which'll resolved doc edit. :tada:


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 :joy:

1 Like

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