Skip to content

Using ILM's move-to-step while ILM is stopped can still execute steps #81234

@dakrone

Description

@dakrone

When using ILM's move-to-step API, the API unconditionally executes certain types of steps when the index is moved into the step, for example:

PUT /_ilm/policy/fmpolicy
{
  "policy": {
    "phases": {
      "hot": {
        "actions": {
          "rollover": {
            "max_age": "60m"
          }
        }
      },
      "warm": {
        "actions": {
          "forcemerge": {
            "max_num_segments": 1
          }
        }
      },
      "delete": {
        "min_age": "1d",
        "actions":{
          "delete": {}
        }
      }
    }
  }
}

PUT /myindex-000001
{
  "settings": {
    "index.lifecycle.name": "fmpolicy",
    "index.lifecycle.rollover_alias": "myalias"
  },
  "aliases": {
    "myalias": {"is_write_index": true}
  }
}

GET /myindex-*/_ilm/explain?human

POST /_ilm/stop

GET /_ilm/status

POST /_ilm/move/myindex-000001
{
  "current_step": {
    "phase": "hot",
    "action": "rollover",
    "name": "check-rollover-ready"
  },
  "next_step": {
    "phase": "warm",
    "action": "forcemerge",
    "name": "readonly"
  }
}

This should move from the rollover into the readonly step, however, when the move is executed, the readonly step is actually executed and the index ends up in:

{
  "indices" : {
    "myindex-000001" : {
      "index" : "myindex-000001",
      "managed" : true,
      "policy" : "fmpolicy",
      "phase" : "warm",
      "action" : "forcemerge",
      "step" : "segment-count",
      ...
    }
  }
}

It has advanced to the segment-count step rather than remaining in the readonly step (which is what I moved it to).

We should not execute steps when they are moved into if ILM is stopped, instead we should handle them correctly when ILM is restarted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Data Management/ILM+SLMDO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead.>bugTeam:Data Management (obsolete)DO NOT USE. This team no longer exists.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions