# ILM index priority not being set correctly

**URL:** https://discuss.elastic.co/t/ilm-index-priority-not-being-set-correctly/250379
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [September 29, 2020, 2:35pm UTC](https://discuss.elastic.co/t/ilm-index-priority-not-being-set-correctly/250379 "2020-09-29T14:35:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![samcook](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@samcook](https://discuss.elastic.co/u/samcook)
#### Post date: [September 29, 2020, 2:35pm UTC](https://discuss.elastic.co/t/ilm-index-priority-not-being-set-correctly/250379/1 "2020-09-29T14:35:45Z")

</div>

I have an ILM policy defined that looks like this:

```auto
GET _ilm/policy/warm-shrink-merge-after-1-year
{
  "warm-shrink-merge-after-1-year" : {
    "version" : 1,
    "modified_date" : "2020-09-28T23:03:18.959Z",
    "policy" : {
      "phases" : {
        "hot" : {
          "min_age" : "0ms",
          "actions" : {
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "warm" : {
          "min_age" : "396d",
          "actions" : {
            "allocate" : {
              "number_of_replicas" : 0,
              "include" : { },
              "exclude" : { },
              "require" : {
                "data" : "warm"
              }
            },
            "forcemerge" : {
              "max_num_segments" : 1
            },
            "set_priority" : {
              "priority" : 50
            },
            "shrink" : {
              "number_of_shards" : 1
            }
          }
        }
      }
    }
  }
}

```

I've applied this policy to some indexes, and everything seems to be working (shard and replica numbers changed, segments merged, moved to nodes with "warm" attribute) except that the priority of my warm indexes ends up being 100, not 50. Am I doing something wrong here?

```auto
GET /apirequest-prod-2018.12/_ilm/explain
{
  "indices" : {
    "shrink-apirequest-prod-2018.12" : {
      "index" : "shrink-apirequest-prod-2018.12",
      "managed" : true,
      "policy" : "warm-shrink-merge-after-1-year",
      "lifecycle_date_millis" : 1543622406182,
      "age" : "668.6d",
      "phase" : "warm",
      "action" : "complete",
      "action_time_millis" : 1601336208877,
      "step" : "complete",
      "step_time_millis" : 1601336208877
    }
  }
}

```

```auto
GET /apirequest-prod-2018.12/_settings
{
  "shrink-apirequest-prod-2018.12" : {
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "warm-shrink-merge-after-1-year"
        },
        "routing" : {
          "allocation" : {
            "initial_recovery" : {
              "_id" : "_G4C70tnRvG3G4curdzFkQ"
            },
            "require" : {
              "data" : "warm",
              "_id" : null
            }
          }
        },
        "number_of_shards" : "1",
        "routing_partition_size" : "1",
        "blocks" : {
          "write" : "true"
        },
        "provided_name" : "shrink-apirequest-prod-2018.12",
        "resize" : {
          "source" : {
            "name" : "apirequest-prod-2018.12",
            "uuid" : "ggpZLn2mT5GvqzzI4my_VA"
          }
        },
        "creation_date" : "1601335609424",
        "priority" : "100",
        "number_of_replicas" : "0",
        "uuid" : "CMI8mTGBSZekR3ArmsbGrg",
        "version" : {
          "created" : "6030199",
          "upgraded" : "7010199"
        }
      }
    }
  }
}

```

Running ES 7.9.2

---

<div class="post-metadata">

### Author: ![samcook](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@samcook](https://discuss.elastic.co/u/samcook)
#### Post date: [September 29, 2020, 3:12pm UTC](https://discuss.elastic.co/t/ilm-index-priority-not-being-set-correctly/250379/2 "2020-09-29T15:12:43Z")

</div>

From further observation, it seems like the priority is correctly set to 50 as the warm phase runs, but then is set to 100 again perhaps due to the shrink operation.

Is that the expected behaviour?

---

<div class="post-metadata">

### Author: ![samcook](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@samcook](https://discuss.elastic.co/u/samcook)
#### Post date: [October 26, 2020, 2:08pm UTC](https://discuss.elastic.co/t/ilm-index-priority-not-being-set-correctly/250379/3 "2020-10-26T14:08:24Z")

</div>

Hi, anyone have any thoughts on the correct way to do this?

---

<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 23, 2020, 2:08pm UTC](https://discuss.elastic.co/t/ilm-index-priority-not-being-set-correctly/250379/4 "2020-11-23T14:08:27Z")

</div>

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