SM shrink works, but source index isn’t deleted afterward: how should I delete the original?

I’m using an (ISM) policy to make indices read-only at 7 days, shrink them at 8 days, and then delete the original index after shrinking. The shrink step succeeds and the -shrunk index is created (aliases switch correctly), but the source/original index never gets deleted. Everything else in the policy works as expected. I also have a separate policy that deletes the shrunk index after a later retention period.

Policy (current)

{
  "id": "main-policy",
  "policy": {
    "policy_id": "main-policy",
    "description": "Make indices read-only after 7d, shrink at 8d, then delete the original",
    "schema_version": 21,
    "default_state": "active",
    "states": [
      {
        "name": "active",
        "actions": [],
        "transitions": [
          {
            "state_name": "read_only",
            "conditions": { "min_index_age": "7d" }
          }
        ]
      },
      {
        "name": "read_only",
        "actions": [
          {
            "retry": { "count": 3, "backoff": "exponential", "delay": "1m" },
            "read_only": {}
          },
          {
            "retry": { "count": 3, "backoff": "exponential", "delay": "1m" },
            "force_merge": { "max_num_segments": 1 }
          }
        ],
        "transitions": [
          {
            "state_name": "shrink",
            "conditions": { "min_index_age": "8d" }
          }
        ]
      },
      {
        "name": "shrink",
        "actions": [
          {
            "retry": { "count": 3, "backoff": "exponential", "delay": "1m" },
            "shrink": {
              "num_new_shards": 1,
              "target_index_name_template": {
                "source": "{{ctx.index}}-shrunk",
                "lang": "mustache"
              },
              "aliases": [
                { "{{ctx.index}}": { "is_write_index": null } }
              ],
              "switch_aliases": true
            }
          }
        ],
        "transitions": [
          {
            "state_name": "delete_original",
            "conditions": { "min_index_age": "9d" }
          }
        ]
      },
      {
        "name": "delete_original",
        "actions": [
          {
            "retry": { "count": 3, "backoff": "exponential", "delay": "1m" },
            "delete": {}
          }
        ],
        "transitions": []
      }
    ],
    "ism_template": [
      {
        "index_patterns": ["weekly-logs-*"],
        "priority": 100
      }
    ]
  }
}

What I expect

  • After shrink, the policy transitions into delete_original and deletes the source/original index.

What actually happens

  • Shrink succeeds, {{ctx.index}}-shrunk is created, aliases switch as expected.

  • The original (pre-shrink) index remains and is never deleted.

Questions

  1. After a shrink action, does ISM continue managing the target (shrunk) index rather than the source index? If so, is that why the delete action isn’t hitting the original?

  2. What’s the recommended pattern to delete the source index immediately after a successful shrink?

    • Is there a built-in way for the shrink action to delete the source automatically?

    • Or should I use a separate, short-lived policy (or a job/hook) targeting the original index to remove it right after shrink?

  3. If the above is policy-dependent, is there a specific config (e.g., parameter on shrink, alias strategy, or a different state layout) that ensures the source gets deleted?

Troubleshooting done so far

  • Verified -shrunk creation and alias switching.

  • Confirmed a separate policy successfully deletes -shrunk indices later.

  • The only gap is deleting the original immediately post-shrink.

Any guidance or examples showing how to reliably delete the source index after shrinking would be much appreciated. Thanks!

@mbdevops can you provide the output to the below command:

GET _plugins/_ism/explain/<index_that_should_have_been_deleted>

I think the same policy gets applied to the newly created index as weekly-logs-* will capture “weekly-logs-…-shrunk”. To test this, I would recommend to create a new test index and apply the policy only to this index. After the shrink step, old index should be deleted.

Hi Anthony, thanks for the pointers. I shortened the timelines to reproduce more quickly and tweaked the policy, but I’m still seeing the same behavior.


GET _plugins/_ism/explain/weekly-logs-08.09.2025

{
  "weekly-logs-08.09.2025": {
    "index.plugins.index_state_management.policy_id": "main-policy",
    "index.opendistro.index_state_management.policy_id": "main-policy",
    "index": "weekly-logs-08.09.2025",
    "index_uuid": "k3RM-6HfSYyw30lxr3qq6g",
    "policy_id": "main-policy",
    "policy_seq_no": 15650,
    "policy_primary_term": 1,
    "index_creation_date": 1757333193008,
    "state": {
      "name": "shrink",
      "start_time": 1757335774553
    },
    "action": {
      "name": "shrink",
      "start_time": 1757335774553,
      "index": 0,
      "failed": true,
      "consumed_retries": 3,
      "last_retry_time": 1757337151037,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "ba5759eeb490d99470861c8b26819273",
          "target_index_name": "weekly-logs-08.09.2025-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9432,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757335775,
          "lock_duration_second": 2700,
          "original_index_settings": {
            "index.blocks.write": "false"
          }
        }
      }
    },
    "step": {
      "name": "attempt_move_shards_step",
      "start_time": 1757336885440,
      "step_status": "failed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Shrink failed because weekly-logs-08.09.2025-shrunk already exists."
    },
    "enabled": false
  },
  "total_managed_indices": 1
}

Notes:

  • The -shrunk index was created (and later deleted by a different policy), but the source index never progressed to deletion.

  • After the failed retries, enabled: false appears on the managed index.


Current policies (testing timelines)

Main policy (shrinks, no post-shrink transition in this test)

{
  "policy_id": "main-policy",
  "default_state": "active",
  "states": [
    {
      "name": "active",
      "actions": [],
      "transitions": [{ "state_name": "read_only", "conditions": { "min_index_age": "10m" } }]
    },
    {
      "name": "read_only",
      "actions": [
        { "retry": { "count": 3, "backoff": "exponential", "delay": "1m" }, "read_only": {} },
        { "retry": { "count": 3, "backoff": "exponential", "delay": "1m" }, "force_merge": { "max_num_segments": 1 } }
      ],
      "transitions": [{ "state_name": "shrink", "conditions": { "min_index_age": "15m" } }]
    },
    {
      "name": "shrink",
      "actions": [
        {
          "retry": { "count": 3, "backoff": "exponential", "delay": "1m" },
          "shrink": {
            "num_new_shards": 1,
            "target_index_name_template": { "source": "{{ctx.index}}-shrunk", "lang": "mustache" },
            "aliases": [{ "{{ctx.index}}": { "is_write_index": null } }],
            "switch_aliases": true
          }
        }
      ],
      "transitions": []
    }
  ],
  "ism_template": [{ "index_patterns": ["weekly-logs-*", "!*-shrunk"], "priority": 100 }]
}

Secondary policy (intended to delete the original later)

{
    "id": "cleanup-original-policy",
    "seqNo": 22307,
    "primaryTerm": 1,
    "policy": {
        "policy_id": "cleanup-original-policy",
        "description": "A sample description of the policy",
        "last_updated_time": 1757333144680,
        "schema_version": 21,
        "error_notification": null,
        "default_state": "close_original",
        "states": [
            {
                "name": "close_original",
                "actions": [
                    {
                        "retry": {
                            "count": 3,
                            "backoff": "exponential",
                            "delay": "1m"
                        },
                        "close": {}
                    }
                ],
                "transitions": [
                    {
                        "state_name": "delete_original",
                        "conditions": {
                            "min_index_age": "25m"
                        }
                    }
                ]
            },
            {
                "name": "delete_original",
                "actions": [
                    {
                        "retry": {
                            "count": 3,
                            "backoff": "exponential",
                            "delay": "1m"
                        },
                        "delete": {}
                    }
                ],
                "transitions": []
            }
        ],
        "ism_template": [
            {
                "index_patterns": [
                    "weekly-logs-*",
                    "!*-shrunk"
                ],
                "priority": 50,
                "last_updated_time": 1757332614442
            }
        ]
    }
}

Happy to revert to the earlier policy and re-run explain if that helps. Thanks for any tips or examples on getting this flow (shrink → delete source → later delete shrunk) working reliably.

@mbdevops cna you run this on a test index to avoid issues you are seeing here: “Shrink failed because weekly-logs-08.09.2025-shrunk already exists.” Using the same approach and only one policy?

Hi Anthony, i reverted the policies as requested and re-created the index with random data and still get the below once the shrink has completed.

{
  "weekly-logs-08.09.2025": {
    "index.plugins.index_state_management.policy_id": "main-policy",
    "index.opendistro.index_state_management.policy_id": "main-policy",
    "index": "weekly-logs-08.09.2025",
    "index_uuid": "ubCXzAfPRGesskIGGO-LWw",
    "policy_id": "main-policy",
    "policy_seq_no": 15650,
    "policy_primary_term": 1,
    "index_creation_date": 1757344595395,
    "state": {
      "name": "shrink",
      "start_time": 1757347084324
    },
    "action": {
      "name": "shrink",
      "start_time": 1757347084324,
      "index": 0,
      "failed": true,
      "consumed_retries": 3,
      "last_retry_time": 1757348610318,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "ba5759eeb490d99470861c8b26819273",
          "target_index_name": "weekly-logs-08.09.2025-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9437,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757347085,
          "lock_duration_second": 2700,
          "original_index_settings": {
            "index.blocks.write": "false"
          }
        }
      }
    },
    "step": {
      "name": "attempt_move_shards_step",
      "start_time": 1757348319235,
      "step_status": "failed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Shrink failed because weekly-logs-08.09.2025-shrunk already exists."
    },
    "enabled": false
  },
  "total_managed_indices": 1
}

@mbdevops Am I understanding this correctly, before this ISM ran, there was no weekly-logs-08.09.2025-shrunk index, then after it ran, index weekly-logs-08.09.2025-shrunk was created, but the above is the output of the _ism/explain call?

That is 100% correct.

@mbdevops I am not able to reproduce this, would you be able to create indices completely different to previous ones. Something is probably interfering with the policy you are using on that index “weekly-logs*”

See example below:

PUT sm-src-000001
{
  "settings": {
    "number_of_shards": 2,
    "number_of_replicas": 0
  },
  "mappings": {
    "properties": {
      "msg": { "type": "keyword" }
    }
  },
  "aliases": {
    "sm-demo": {}    // optional alias so searches can continue after shrink
  }
}

POST sm-src-000001/_bulk
{"index":{}}
{"msg":"a"}
{"index":{}}
{"msg":"b"}

PUT _plugins/_ism/policies/sm-shrink-then-delete2
{
  "policy": {
    "description": "Shrink now, then delete source",
    "default_state": "shrink_now",
    "states": [
      {
        "name": "shrink_now",
        "actions": [
          {
            "shrink": {
              "num_new_shards": 1,
              "target_index_name_template": "{{ctx.index}}-shrunk",
              "switch_aliases": true,
              "force_unsafe": true
            }
          }
        ],
        "transitions": [
          { "state_name": "delete_source", "conditions": { "min_index_age": "1m" } }
        ]
      },
      {
        "name": "delete_source",
        "actions": [ { "delete": {} } ]
      }
    ]
  }
}

POST _plugins/_ism/add/sm-src-000001
{ "policy_id": "sm-shrink-then-delete2" }

Can you then run below periodically and record the returned messages:

GET _plugins/_ism/explain/sm-src-000001

So that appeared to work. Unsure why mine is failing?

{
  "sm-src-000001": {
    "index.plugins.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index.opendistro.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index": "sm-src-000001",
    "index_uuid": "3gAPXdIlQCqKCiE0M_iPjw",
    "policy_id": "sm-shrink-then-delete2",
    "policy_seq_no": 18832,
    "policy_primary_term": 1,
    "index_creation_date": 1757420378249,
    "state": {
      "name": "shrink_now",
      "start_time": 1757420800673
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Successfully initialized policy: sm-shrink-then-delete2"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

@mbdevops did you monitor the policy all the way through to completion? as the above is only the first stage. If it does work, this could indicate your policy is getting applied to the newly created index.

Hi Anthony, apologies checking again it now has the below output.

{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: no documents to get;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: no documents to get;"
  },
  "status": 400
}

& then checking the shrunk index (which is not managed)

{
  "sm-src-000001-shrunk": {
    "index.plugins.index_state_management.policy_id": null,
    "index.opendistro.index_state_management.policy_id": null,
    "enabled": null
  },
  "total_managed_indices": 0
}

I can see the original index has been deleted as it’s not present in my indexes and only the shrunk index remains.

Do you think it could be the set to R/O and then to shrink that is causing the issue? I have considered making seperate policies for these and having it set to R/O then another to shrink and delete.

I don’t think readonly is the issue, as I’m just ran a test using the following and it was still deleted:

PUT _plugins/_ism/policies/sm-shrink-then-delete2
{
  "policy": {
    "description": "Shrink now, then delete source",
    "default_state": "shrink_now",
    "states": [
      {
        "name": "shrink_now",
        "actions": [
          { "read_only": {} },
          {
            "shrink": {
              "num_new_shards": 1,
              "target_index_name_template": "{{ctx.index}}-shrunk",
              "switch_aliases": true,
              "force_unsafe": true
            }
          }
        ],
        "transitions": [
          { "state_name": "delete_source", "conditions": { "min_index_age": "1m" } }
        ]
      },
      {
        "name": "delete_source",
        "actions": [ { "delete": {} } ]
      }
    ]
  }
}

Hi Apologies, I think there is some confusion.

When I run the policy you provided. The original is deleted after it has been shrunk and only the shrunk policy remains.

@mbdevops what version of OS are you running?

I have seen issues where any step that fails along the way will cause the issue of “index already exists” on the next step.

I would recommend to monitor with explain call all the steps that are taken and check for errors. For example I was able to reproduce your error by not adding alias to the index.

@Anthony I am running 2.19 and it’s an AWS managed cluster.

@mbdevops can you monitor all the steps with GET _plugins/_ism/explain/<index> and provide the responses?

@Anthony I have ran an update on the cluster and and your policy appears to work as expected with the original being deleted and only the shrunk one remains. Here is the output.

{
  "sm-src-000001": {
    "index.plugins.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index.opendistro.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index": "sm-src-000001",
    "index_uuid": "fEQPBrkSQlSwf3RcP05ZWQ",
    "policy_id": "sm-shrink-then-delete2",
    "enabled": true
  },
  "total_managed_indices": 1
}


{
  "sm-src-000001": {
    "index.plugins.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index.opendistro.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index": "sm-src-000001",
    "index_uuid": "fEQPBrkSQlSwf3RcP05ZWQ",
    "policy_id": "sm-shrink-then-delete2",
    "policy_seq_no": 18875,
    "policy_primary_term": 1,
    "index_creation_date": 1757498433396,
    "state": {
      "name": "shrink_now",
      "start_time": 1757498914971
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Successfully initialized policy: sm-shrink-then-delete2"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}
{
  "sm-src-000001": {
    "index.plugins.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index.opendistro.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index": "sm-src-000001",
    "index_uuid": "fEQPBrkSQlSwf3RcP05ZWQ",
    "policy_id": "sm-shrink-then-delete2",
    "policy_seq_no": 18875,
    "policy_primary_term": 1,
    "index_creation_date": 1757498433396,
    "state": {
      "name": "shrink_now",
      "start_time": 1757498914971
    },
    "action": {
      "name": "shrink",
      "start_time": 1757499134143,
      "index": 0,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "80e673e07734e04520cc360be15d9370",
          "target_index_name": "sm-src-000001-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9461,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757499135,
          "lock_duration_second": 2700,
          "original_index_settings": {}
        }
      }
    },
    "step": {
      "name": "attempt_move_shards_step",
      "start_time": 1757499134143,
      "step_status": "completed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Successfully initialized moving the shards to 80e673e07734e04520cc360be15d9370 for a shrink action."
    },
    "enabled": true
  },
  "total_managed_indices": 1
}
{
  "sm-src-000001": {
    "index.plugins.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index.opendistro.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index": "sm-src-000001",
    "index_uuid": "fEQPBrkSQlSwf3RcP05ZWQ",
    "policy_id": "sm-shrink-then-delete2",
    "policy_seq_no": 18875,
    "policy_primary_term": 1,
    "index_creation_date": 1757498433396,
    "state": {
      "name": "shrink_now",
      "start_time": 1757498914971
    },
    "action": {
      "name": "shrink",
      "start_time": 1757499134143,
      "index": 0,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "80e673e07734e04520cc360be15d9370",
          "target_index_name": "sm-src-000001-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9463,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757499740,
          "lock_duration_second": 2700,
          "original_index_settings": {}
        }
      }
    },
    "step": {
      "name": "attempt_shrink_step",
      "start_time": 1757499739569,
      "step_status": "completed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Shrink started. sm-src-000001-shrunk currently being populated."
    },
    "enabled": true
  },
  "total_managed_indices": 1
}


{
  "sm-src-000001": {
    "index.plugins.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index.opendistro.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index": "sm-src-000001",
    "index_uuid": "fEQPBrkSQlSwf3RcP05ZWQ",
    "policy_id": "sm-shrink-then-delete2",
    "policy_seq_no": 18875,
    "policy_primary_term": 1,
    "index_creation_date": 1757498433396,
    "state": {
      "name": "shrink_now",
      "start_time": 1757498914971
    },
    "action": {
      "name": "shrink",
      "start_time": 1757499134143,
      "index": 0,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "80e673e07734e04520cc360be15d9370",
          "target_index_name": "sm-src-000001-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9464,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757500004,
          "lock_duration_second": 2700,
          "original_index_settings": {}
        }
      }
    },
    "step": {
      "name": "wait_for_shrink_step",
      "start_time": 1757500003154,
      "step_status": "completed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Shrink finished successfully."
    },
    "enabled": true
  },
  "total_managed_indices": 1
{
  "sm-src-000001": {
    "index.plugins.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index.opendistro.index_state_management.policy_id": "sm-shrink-then-delete2",
    "index": "sm-src-000001",
    "index_uuid": "fEQPBrkSQlSwf3RcP05ZWQ",
    "policy_id": "sm-shrink-then-delete2",
    "policy_seq_no": 18875,
    "policy_primary_term": 1,
    "index_creation_date": 1757498433396,
    "transition_to": "delete_source",
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Transitioning to delete_source [index=sm-src-000001]"
    },
    "enabled": true
  },
  "total_managed_indices": 1


@mbdevops can you the same with policy that is failing to delete

I have done so here. The shrink step fails due to an alias switch issue, however the shrunk index is created. I have added all output below.

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "enabled": true
  },
  "total_managed_indices": 1
}

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "active",
      "start_time": 1757503344069
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Successfully initialized policy: main"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "transition_to": "read_only",
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Transitioning to read_only [index=weekly-logs-10.09.2025]"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "read_only",
      "start_time": 1757503801868
    },
    "action": {
      "name": "read_only",
      "start_time": 1757503801868,
      "index": 0,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0
    },
    "step": {
      "name": "set_read_only",
      "start_time": 1757503801868,
      "step_status": "completed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Successfully set index to read-only [index=weekly-logs-10.09.2025]"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "read_only",
      "start_time": 1757503801868
    },
    "action": {
      "name": "force_merge",
      "start_time": 1757504167123,
      "index": 1,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0
    },
    "step": {
      "name": "attempt_call_force_merge",
      "start_time": 1757504420209,
      "step_status": "starting"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Starting action force_merge and working on attempt_call_force_merge"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "read_only",
      "start_time": 1757503801868
    },
    "action": {
      "name": "force_merge",
      "start_time": 1757504167123,
      "index": 1,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0,
      "action_properties": {
        "max_num_segments": 1
      }
    },
    "step": {
      "name": "attempt_call_force_merge",
      "start_time": 1757504420209,
      "step_status": "completed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Successfully completed force merge [index=weekly-logs-10.09.2025]"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "read_only",
      "start_time": 1757503801868
    },
    "action": {
      "name": "force_merge",
      "start_time": 1757504167123,
      "index": 1,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0
    },
    "step": {
      "name": "wait_for_force_merge",
      "start_time": 1757504722856,
      "step_status": "completed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Successfully confirmed segments force merged [index=weekly-logs-10.09.2025]"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}
{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "transition_to": "shrink",
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Transitioning to shrink [index=weekly-logs-10.09.2025]"
    },
    "enabled": true
  },
  "total_managed_indices": 1
}
{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "shrink",
      "start_time": 1757505361013
    },
    "action": {
      "name": "shrink",
      "start_time": 1757505361013,
      "index": 0,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "80e673e07734e04520cc360be15d9370",
          "target_index_name": "weekly-logs-10.09.2025-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9466,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757505361,
          "lock_duration_second": 2700,
          "original_index_settings": {
            "index.blocks.write": "false"
          }
        }
      }
    },
    "step": {
      "name": "attempt_move_shards_step",
      "start_time": 1757505361013,
      "step_status": "completed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Successfully initialized moving the shards to 80e673e07734e04520cc360be15d9370 for a shrink action."
    },
    "enabled": true
  },
  "total_managed_indices": 1
}


{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "shrink",
      "start_time": 1757505361013
    },
    "action": {
      "name": "shrink",
      "start_time": 1757505361013,
      "index": 0,
      "failed": false,
      "consumed_retries": 0,
      "last_retry_time": 0,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "80e673e07734e04520cc360be15d9370",
          "target_index_name": "weekly-logs-10.09.2025-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9467,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757505621,
          "lock_duration_second": 2700,
          "original_index_settings": {
            "index.blocks.write": "false"
          }
        }
      }
    },
    "step": {
      "name": "wait_for_move_shards_step",
      "start_time": 1757505620712,
      "step_status": "completed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "The shards successfully moved to 80e673e07734e04520cc360be15d9370."
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "shrink",
      "start_time": 1757505361013
    },
    "action": {
      "name": "shrink",
      "start_time": 1757505361013,
      "index": 0,
      "failed": false,
      "consumed_retries": 1,
      "last_retry_time": 1757506302214,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "80e673e07734e04520cc360be15d9370",
          "target_index_name": "weekly-logs-10.09.2025-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9469,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757506300,
          "lock_duration_second": 2700,
          "original_index_settings": {
            "index.blocks.write": "false"
          }
        }
      }
    },
    "step": {
      "name": "wait_for_shrink_step",
      "start_time": 1757506300767,
      "step_status": "failed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Shrink failed due to aliases switch failure."
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

{
  "weekly-logs-10.09.2025": {
    "index.plugins.index_state_management.policy_id": "main",
    "index.opendistro.index_state_management.policy_id": "main",
    "index": "weekly-logs-10.09.2025",
    "index_uuid": "GIaLUNNYT42KTJadhcHMkA",
    "policy_id": "main",
    "policy_seq_no": 13696,
    "policy_primary_term": 1,
    "index_creation_date": 1757502878881,
    "state": {
      "name": "shrink",
      "start_time": 1757505361013
    },
    "action": {
      "name": "shrink",
      "start_time": 1757505361013,
      "index": 0,
      "failed": false,
      "consumed_retries": 2,
      "last_retry_time": 1757506501907,
      "action_properties": {
        "shrink_action_properties": {
          "node_name": "80e673e07734e04520cc360be15d9370",
          "target_index_name": "weekly-logs-10.09.2025-shrunk",
          "target_num_shards": 1,
          "lock_seq_no": 9466,
          "lock_primary_term": 1,
          "lock_epoch_second": 1757505361,
          "lock_duration_second": 2700,
          "original_index_settings": {
            "index.blocks.write": "false"
          }
        }
      }
    },
    "step": {
      "name": "attempt_move_shards_step",
      "start_time": 1757506501520,
      "step_status": "failed"
    },
    "retry_info": {
      "failed": false,
      "consumed_retries": 0
    },
    "info": {
      "message": "Shrink failed because weekly-logs-10.09.2025-shrunk already exists."
    },
    "enabled": true
  },
  "total_managed_indices": 1
}

@mbdevops does the index have an alias? if not, you will need to remove the

"switch_aliases": true,
1 Like