index-management
index-management copied to clipboard
I have create a index roll-over and delete policy but data not deleted
Describe the bug policy has been apply but data not deleted.
please look at policy..
{ "policy": { "policy_id": "Data-rollover", "description": "hot warm delete workflow", "last_updated_time": 1657718012858, "schema_version": 12, "error_notification": null, "default_state": "hot", "states": [ { "name": "hot", "actions": [ { "rollover": { "min_index_age": "1d" } } ], "transitions": [ { "state_name": "warm" } ] }, { "name": "warm", "actions": [ { "replica_count": { "number_of_replicas": 0 } } ], "transitions": [ { "state_name": "delete", "conditions": { "min_index_age": "30d" } } ] }, { "name": "delete", "actions": [ { "notification": { "destination": { "slack": { "url": "<URL>" } }, "message_template": { "source": "The index {{ctx.index}} is being deleted", "lang": "mustache" } } }, { "delete": {} } ], "transitions": [] } ], "ism_template": [ { "index_patterns": [ "abc", "xyz" ], "priority": 100, "last_updated_time": 1657718012858 } ] } }
I also attached screenshort please look at.
Can check the ISM running status using explain API, it will show what state your managed index is in and whether it any ISM action failed because of some exception.
@bowenlan-amzn
when i am running the explain API query getting following response
Can you give the explain result for the problem index, not this 08.01
which seems to be the latest index created today.
On the frontend, there's a Policy managed indices
page, from that page, you can also see the ISM running status (explain API response) for your index.
@bowenlan-amzn Hello, I have attached older than 30 days index. Kindly check it
Sorry for losing track on this.
Lemme provide you some more tools to figure out what's going on
- ISM runs action using a fixed-time interval scheduled job, the interval of job is controlled by a cluster setting
plugins.index_state_management.job_interval
, default to 5m. So you have an estimate of the running frequency and can look for ISM related logs in opensearch.log. - For each index that's being managed, we saved a
managed_index
job document into our configuration indexopendistro-ism-config
. So you can query the config index for themanaged_index
job of your index, to see if it's enabled (running). During running, we also savedmanaged_index_metadata
document which record the current running status like which state, action, step ISM is doing.- Here are the mapping of our configuration index for you write your query. An example query is like:
GET .opendistro-ism-config/_search
{
"query": {
"exists": {
"field": "managed_index"
}
}
}
Hi, facing the same problem, i'm on ODFE(selfhosted openserch) @dipenpatel235 did you found a solution? @bowenlan-amzn more tools that you provided didn't helped to solve the problem.
had the same issue. after re-applying the policy, the indices have been deleted
For me indexes are deleted but not on the certain time I gave. I gave 10 sec to get deleted but it is taking lot of time to initialise and then to perform the action.
Here is my policy:
{
"policy_id": "log_policy_for_delete",
"description": "delete after 10s",
"last_updated_time": 1695921405668,
"schema_version": 18,
"error_notification": null,
"default_state": "delete",
"states": [
{
"name": "hold",
"actions": [],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "10s"
}
}
]
},
{
"name": "delete",
"actions": [
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"delete": {}
}
],
"transitions": []
}
],
"ism_template": [
{
"index_patterns": [
"aman*"
],
"priority": 1,
"last_updated_time": 1695921405668
}
]
}