ILM phase don't delete indexes, only clean up

I cretaed ILM policy for two steps. It's hot and delete.

full template

PUT _ilm/policy/logstash-f-lb
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_age": "7d"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "delete": {
        "min_age": "1d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }

but I still have cleaned index which have size couple Kb. Why they not deleted ?

Not sure, but it might be related to the rollover action.
Try to remove it and test.

remove - cleaned indexes?

remove it from the policy.
Did it work?

I found out that you mean.
I should disable buttom "Enable rollover" in GUI.
And I should set in delete phase count days which I want collected indexes.
Then I turn of rollover for hot phase.

{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "set_priority": {
            "priority": 100
          }
        }
      },
      "delete": {
        "min_age": "7d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }

and wait 2 hours and nothing

GET .ds-logstash-startrack-alb-2021.01.12-000002/_ilm/explain
{
  "indices" : {
    ".ds-logstash-startrack-alb-2021.01.12-000002" : {
      "index" : ".ds-logstash-startrack-alb-2021.01.12-000002",
      "managed" : true,
      "policy" : "logstash-startrack-alb",
      "lifecycle_date_millis" : 1611014984815,
      "age" : "1.5d",
      "phase" : "hot",
      "phase_time_millis" : 1611014987822,
      "action" : "rollover",
      "action_time_millis" : 1611015588727,
      "step" : "check-rollover-ready",
      "step_time_millis" : 1611015588727,
      "phase_execution" : {
        "policy" : "logstash-startrack-alb",
        "phase_definition" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_age" : "7d"
            },
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "version" : 3,
        "modified_date_in_millis" : 1610524924771
      }

Not work, I foun out log

"Caused by: java.lang.IllegalArgumentException: step [{\"phase\":\"hot\",\"action\":\"rollover\",\"name\":\"attempt-rollover\"}] for index [.ds-logstash-startrack-alb-2021.01.14-000001] with policy [logstash-startrack-alb] does not exist",

New index whith changed ilm policy has output

{
  "indices" : {
    ".ds-logstash-startrack-alb-2021.01.21-000001" : {
      "index" : ".ds-logstash-startrack-alb-2021.01.21-000001",
      "managed" : true,
      "policy" : "logstash-startrack-alb",
      "lifecycle_date_millis" : 1611187303361,
      "age" : "1.4d",
      "phase" : "hot",
      "phase_time_millis" : 1611187304048,
      "action" : "complete",
      "action_time_millis" : 1611187304245,
      "step" : "complete",
      "step_time_millis" : 1611187304245,
      "phase_execution" : {
        "policy" : "logstash-startrack-alb",
        "phase_definition" : {
          "min_age" : "0ms",
          "actions" : {
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "version" : 4,
        "modified_date_in_millis" : 1611138445471

which dosen't have information about rollover as:

      "action" : "rollover",
      "step" : "check-rollover-ready",

and etc.
I think that new ilm policy whitout rollover action will work fine when will faced with index without rollover settings.
But how now fixed problems with indexes which contain rollover settings and can't be deleted?

New ilm policy will work with new indexes which created with changed ilm at index template. If we will do change from old to new ilm policy in every index this will result an error.

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