ILM not deleting indices

I created this policy for testing e apliquei a um template:

{
    "policy": {
      "phases": {
        "hot": {
          "min_age": "0ms",
          "actions": {
            "set_priority": {
              "priority": 100
            }
          }
        },
        "delete": {
          "min_age": "60ms",
          "actions": {
            "delete": {}
          }
        }
      }
    }
}

However, the index is not being excluded. The return from /_ilm/explain shows:

{
  "indices": {
    "example-index-name": {
      "index": "example-index-name",
      "managed": true,
      "policy": "example-policy-name",
      "lifecycle_date_millis": 1590542282531,
      "age": "2.48m",
      "phase": "delete",
      "phase_time_millis": 1590542283687,
      "action": "delete",
      "action_time_millis": 1590542283687,
      "step": "wait-for-shard-history-leases",
      "step_time_millis": 1590542283687,
      "phase_execution": {
        "policy": "example-policy-name",
        "phase_definition": {
          "min_age": "60ms",
          "actions": {
            "delete": {}
          }
        },
        "version": 3,
        "modified_date_in_millis": 1590542258883
      }
    }
  }
}
1 Like

By default ILM actions are only checked every 10 minutes, so even with your example setting it to 60 milliseconds, it can take some time for the index to actually be deleted. I recommend you either set the setting lower (you can set it to something like 10 seconds for testing). See https://www.elastic.co/guide/en/elasticsearch/reference/7.6/ilm-settings.html#_cluster_level_settings for the setting

For production, I don't recommend you set it that low, however.

5 Likes

Thank you very much. Shortening the interval in a test environment and considering your explanation all worked as expected.

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