# Index routing allocation require does not work and throws confusing explain

**URL:** <https://discuss.elastic.co/t/index-routing-allocation-require-does-not-work-and-throws-confusing-explain/315873>\
**Category:** Elasticsearch\
**Created:** [October 5, 2022, 12:18pm UTC](https://discuss.elastic.co/t/index-routing-allocation-require-does-not-work-and-throws-confusing-explain/315873 "2022-10-05T12:18:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 5, 2022, 12:18pm UTC](https://discuss.elastic.co/t/index-routing-allocation-require-does-not-work-and-throws-confusing-explain/315873/1 "2022-10-05T12:18:24Z")

</div>

Hello,

I have a cluster on version 7.17 where I'm using a node attribute called `node_type` with the values `hot` and `warm` to allocate shards and move between node type with ILM, all indices have an `index.routing.allocation.require.node_type: "hot"` setting in the template and this work as expected.

Recently I'm starting to create a new cluster on 8.4 and decided to use the native `data_tier` role to allocate shards and move between the nodes with ILM, I have nodes that only have the role **data\_hot** and notes that have the role **data\_warm** and **data\_content**.

The [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/shard-allocation-filtering.html) says that `_tier` is a supported attribute for the `index.routing.allocation.require.{attribute}` setting, so I used the following setting in my template.

```auto
index.routing.allocation.require._tier: "data_hot"

```

But when I try to creat an index, the cluster went red because it was not able to allocate any shard, using the allocation explain API I got the following response.

```auto
    {
      "node_id": "QUc9-REDACTED",
      "node_name": "HOT-NODE",
      "transport_address": "REDACTED:9300",
      "node_attributes": {
        "xpack.installed": "true"
      },
      "node_decision": "no",
      "weight_ranking": 1,
      "deciders": [
        {
          "decider": "filter",
          "decision": "NO",
          "explanation": """node does not match index setting [index.routing.allocation.require] filters [_tier:"data_hot"]"""
        },
        {
          "decider": "data_tier",
          "decision": "NO",
          "explanation": "index has a preference for tiers [data_content] and node does not meet the required [data_content] tier"
        }
      ]
    }

```

It says that the node with the `data_hot` role does not match the setting `_tier: data_hot`, which is not true.

```auto
    "QUc9-REDACTED": {
      "name": "HOT-NODE",
      "transport_address": "REDACTED:9300",
      "host": "REDACTED",
      "ip": "REDACTED",
      "version": "8.4.2",
      "build_flavor": "default",
      "build_type": "rpm",
      "build_hash": "89f8c6d8429db93b816403ee75e5c270b43a940a",
      "total_indexing_buffer": 3221225472,
      "roles": [
        "data_hot",
        "ingest",
        "remote_cluster_client"
      ],
      "attributes": {
        "xpack.installed": "true"
      }

```

It also has a `_tier_preference` for a `data_content` role node, whic the hot node does not have, but the warm node has this role.

In the warm node the allocation explain is the following:

```auto
    {
      "node_id": "IElT-REDACTED",
      "node_name": "WARM-NODE",
      "transport_address": "REDACTED:9300",
      "node_attributes": {
        "xpack.installed": "true"
      },
      "node_decision": "no",
      "weight_ranking": 4,
      "deciders": [
        {
          "decider": "filter",
          "decision": "NO",
          "explanation": """node does not match index setting [index.routing.allocation.require] filters [_tier:"data_hot"]"""
        }
      ]
    }

```

If I add the setting `index.routing.allocation.include._tier_preference: "data_hot"` the shard will then be allocated to the hot nodes.

But I want this to work with the require setting as it work when using a custom attribute.

What is the issue here? Is this a bug? Is the documentation wrong and the `_tier` is not supported?

---

<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 2, 2022, 12:18pm UTC](https://discuss.elastic.co/t/index-routing-allocation-require-does-not-work-and-throws-confusing-explain/315873/2 "2022-11-02T12:18:37Z")

</div>

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