You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Reproduce
Steps to reproduce the behavior: This is easy to do with a terraform provider but could also be scripted.
Spin up a new cluster
create multiple policies in parallel:
curl -X PUT -H 'Content-type: application/json' -d '{"policy":{"default_state":"hot","description":"Rotate index when the size of the index is too big.","ism_template":{"index_patterns":["logs*"],"priority":1000},"states":[{"actions":[{"rollover":{"min_index_age":"7d","min_size":"150gb"}}],"name":"hot","transitions":[{"conditions":{"min_index_age":"14d"},"state_name":"warm"}]},{"actions":[{"retry":{"count":5,"delay":"1h"},"warm_migration":{}}],"name":"warm","transitions":[{"conditions":{"min_index_age":"21d"},"state_name":"delete"}]},{"actions":[{"delete":{}}],"name":"delete"}]}}' localhost:9200/_plugins/_ism/policies/policy_1 &
curl -X PUT -H 'Content-type: application/json' -d '{"policy":{"default_state":"hot","description":"For logs-rejected index. Smaller size and time to live index","ism_template":{"index_patterns":["logs-rejected*"],"priority":2000},"states":[{"actions":[{"rollover":{"min_index_age":"1d","min_size":"150gb"}}],"name":"hot","transitions":[{"conditions":{"min_index_age":"3d"},"state_name":"delete"}]},{"actions":[{"delete":{}}],"name":"delete"}]}}' localhost:9200/_plugins/_ism/policies/policy_2 &
Expected behavior
Instead of a http 400, the specific error code http 409 should be returned, indicating a cluster concurrency issue instead of a request format issue.
Plugins
N/a
Screenshots
N/a
Desktop (please complete the following information):
N/A
Additional context
I believe this code could catch a import org.opensearch.ResourceAlreadyExistsException exception and return the specific error code:
Describe the bug
When creating multiple policies on a fresh AWS OpenSearch cluster, it's likely to hit the following error:
Also see phillbaker/terraform-provider-elasticsearch#226
To Reproduce
Steps to reproduce the behavior: This is easy to do with a terraform provider but could also be scripted.
Expected behavior
Instead of a http 400, the specific error code http 409 should be returned, indicating a cluster concurrency issue instead of a request format issue.
Plugins
N/a
Screenshots
N/a
Desktop (please complete the following information):
N/A
Additional context
I believe this code could catch a
import org.opensearch.ResourceAlreadyExistsException
exception and return the specific error code:index-management/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt
Lines 94 to 101 in 809b3c6
Similar to opensearch-project/security#1402 and opensearch-project/security#1095
The text was updated successfully, but these errors were encountered: