Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
latest
Describe the issue:
I have some indexes,
- I added the policy as
%{
"policy" => %{
"description" => "ISM Policy for rollover and deletion",
"default_state" => "hot",
"states" => [
%{
"name" => "hot",
"actions" => [
%{
"rollover" => %{
"min_index_age" => "30d",
"min_doc_count" => 100_000
}
}
],
"transitions" => [
%{
"state_name" => "delete",
"conditions" => %{
"min_index_age" => "30d"
}
}
]
},
%{
"name" => "delete",
"actions" => [
%{
"delete" => %{}
}
]
}
],
"ism_template" => %{
"index_patterns" => ["benefits_program_user-*"]
}
}
}
everything is good and rollover is setup as well.
but Now I want to change my policy. So I changed my policy such as
%{
"policy" => %{
"description" => "ISM Policy for rollover and deletion",
"default_state" => "hot",
"states" => [
%{
"name" => "hot",
"actions" => [
%{
"rollover" => %{
"min_index_age" => "10d"
}
}
],
"transitions" => [
%{
"state_name" => "delete",
"conditions" => %{
"min_index_age" => "10d"
}
}
]
},
%{
"name" => "delete",
"actions" => [
%{
"delete" => %{}
}
]
}
],
"ism_template" => %{
"index_patterns" => ["benefits_program_user-*"]
}
}
}
What I did was I first updated the policy.
then made a post request to the index with policy id
curl --location 'localhost:9200/_plugins/_ism/change_policy/benefits_program_user-*' \
--header 'Content-Type: application/json' \
--data '{
"policy_id": "benefits_program_user_policy",
"state": "delete",
"include": [
{
"state": "hot"
}
]
}'
response as
{
"updated_indices": 1,
"failures": false,
"failed_indices": []
}
no errors but when I explain the index it still uses the old policy attached to it
where as the policy has been updated
what I am doing wrong, can anyone please point?
Configuration:
docker run -p 9200:9200 -p 9600:9600 -e “discovery.type=single-node” -e “OPENSEARCH_INITIAL_ADMIN_PASSWORD=ABCECFG123@” -e “plugins.security.disabled=true” opensearchproject/opensearch:latest
Relevant Logs or Screenshots: