Using one node ES from the official dockerhub (7.7.1).
I have created a basic delete policy:
"test_policy": {
"version": 1,
"modified_date": "2020-07-13T11:38:15.283Z",
"policy": {
"phases": {
"delete": {
"min_age": "10s",
"actions": {
"delete": {}
}
}
}
}
}
Added the above policy to a template ,using this as an example: https://www.elastic.co/guide/en/elasticsearch/reference/current/set-up-lifecycle-policy.html (note: I didn't use rollover)
PUT _template/my_template
{
"index_patterns": ["test-*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"index.lifecycle.name": "test_policy"
}
}
then I PUT two indices : test-2017-11-12 and test-2222
What happened (according to http://localhost:9200/test-*/_ilm/explain ) is that both indices phase is 'new' even after minutes. Then after 4-5min one index switched to "delete" phase and stucks there. The other one is still in 'new' phase.
"test-2017-11-12": {
"index": "test-2017-11-12",
"managed": true,
"policy": "test_policy",
"lifecycle_date_millis": 1594640489746,
"age": "13.69m",
"phase": "delete",
"phase_time_millis": 1594640734626,
"action": "delete",
"action_time_millis": 1594640734626,
"step": "wait-for-shard-history-leases",
"step_time_millis": 1594640734626,
"phase_execution": {
"policy": "test_policy",
"phase_definition": {
"min_age": "10s",
"actions": {
"delete": {}
}
},
"version": 1,
"modified_date_in_millis": 1594640295283
}
}
edit: finally after 17min!!! the index gets deleted, now the other one stucks at the same phase
1.What is this 'wait-for-shard-history-leases' thing? Couldn't find anything about it in the ES documentation.
2.Even if one hangs at the 'delete' phase why the other index gets blocked by this? Why not all the indices over 10s age go to the delete phase?