Using ISM and CCR together

OpenSearch version: 2.4

Hi!

I use ISM policies to execute rollover operations on indices after their sizes reach a given limit. I also use CCR to replicate data between two clusters.

The leader indices get deleted after 3 days after they roll over. When this happens I would like to automatically delete their follower indices as well.

To achive this I created a separate ISM policy for the follower indices:

{
    "policy": {
        "description": "ism policy",
        "default_state": "default",
        "states": [
            {
                "name": "default",
                "actions": [],
                "transitions": [
                    {
                        "state_name": "delete",
                        "conditions": {
                            "min_index_age": "3d"
                        }
                    }
                ]
            },
            {
                "name": "delete",
                "actions": [
                    {
                        "retry": {
                            "count": 1000,
                            "backoff": "constant",
                            "delay": "10m"
                        },
                        "delete": {}
                    }
                ]

            }
        ],
        "ism_template": {
            "index_patterns": ["follower-*"],
            "priority": 1
        }
    }
}

This policy keeps trying to delete the follower, but it can’t. I get the following error:

{
    "cause": "index [follower-000001] blocked by: [FORBIDDEN/1000/index read-only(cross-cluster-replication)];",
    "message": "Failed to delete index [follower-000001]"
}

The index cannot be deleted because of CCR. The delete operation is blocked for the follower even after the leader gets deleted.

Is there a way to get rid of follower indices with ISM after their leader does not exist anymore?

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