-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[ILM] set policy for index API does not work if index is on complete step for a phase #34302
Copy link
Copy link
Closed
Labels
:Data Management/ILM+SLMDO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead.DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead.>bugblocker
Description
Steps to reproduce:
- Create two policies:
PUT _ilm/my_lifecycle2
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_age": "30s"
}
}
},
"warm": {
"actions": {
"forcemerge": {
"max_num_segments": 1
},
"allocate": {
"number_of_replicas": 1
}
}
},
"delete": {
"minimum_age": "2m",
"actions": {
"delete": {}
}
}
}
}
}
PUT _ilm/my_lifecycle3
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_age": "30s"
}
}
},
"warm": {
"actions": {
"forcemerge": {
"max_num_segments": 1
},
"allocate": {
"number_of_replicas": 1
}
}
},
"delete": {
"minimum_age": "2m",
"actions": {
"delete": {}
}
}
}
}
}
- Create an index template and an index for the policies using
my_lifecycle3:
PUT _template/my_template
{
"index_patterns": ["test-*"],
"settings": {
"number_of_shards": 2,
"number_of_replicas": 0,
"index.lifecycle.name": "my_lifecycle3",
"index.lifecycle.rollover_alias": "test-alias"
}
}
PUT test-000001
{
"aliases": {
"test-alias":{
"is_write_index": true
}
}
}
- Wait for the
test-000001index to complete all actions in the warm phase - Try to move
test-000001to usemy_lifecycle2:
PUT test-000001/_ilm/my_lifecycle2
- Observe error response:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "[complete] is not a valid action for phase [warm] in lifecycle type [timeseries]"
}
],
"type": "illegal_argument_exception",
"reason": "[complete] is not a valid action for phase [warm] in lifecycle type [timeseries]"
},
"status": 400
}
Maybe we should go back to letting users set the index.lifecycle.name setting on the update settings API now that there are no restrictions on when the policy can be changed on an index?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Data Management/ILM+SLMDO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead.DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead.>bugblocker
Type
Fields
Give feedbackNo fields configured for issues without a type.