opensearch-project / index-management

🗃 Automate periodic data operations, such as deleting indices at a certain age or performing a rollover at a certain size
https://opensearch.org/docs/latest/im-plugin/index/
Apache License 2.0
53 stars 110 forks source link

New policy has an ISM template with index pattern matching existing policy templates #1206

Open rishabhToshniwal opened 1 month ago

rishabhToshniwal commented 1 month ago

Describe the bug

I am trying to create an ISM policy for index pattern [*logs-bs.cbes-*] with priority 100 and failing with below error. However I didn't see any policy matching the index pattern already present. When I create the policy with the priority number not present in existing policies it works. I am not sure how these indexes are overlapping ?

{ "error" : { "root_cause" : [ { "type" : "index_management_exception", "reason" : "New policy ism_policy_opensearch_prim630-uat_cbes has an ISM template with index pattern [*logs-bs.cbes-*] matching existing policy templates, please use a different priority than 100" } ], "type" : "index_management_exception", "reason" : "New policy ism_policy_opensearch_prim630-uat_cbes has an ISM template with index pattern [*logs-bs.cbes-*] matching existing policy templates, please use a different priority than 100", "caused_by" : { "type" : "exception", "reason" : "java.lang.IllegalArgumentException: New policy ism_policy_opensearch_prim630-uat_cbes has an ISM template with index pattern [*logs-bs.cbes-*] matching existing policy templates, please use a different priority than 100" } }, "status" : 400 }

The other policies have following index pattern and priority

1. "priority" : 100, "index_patterns" : [ "*abc-es-logging-index-*", "otel-v1-apm-span-*" ],

2. "index_patterns" : [ "*logs-bs.couchbase-*" ], "priority" : 102,

3. "index_patterns" : [ "*logs-bs.elastic-*" ], "priority" : 101,

Related component

Indexing

To Reproduce

  1. Create an ISM policy for the pattern "*logs-bs.couchbase-*" and priority 100
  2. Create another ISM policy for the pattern *logs-bs.cbes-* and priority 100

Expected behavior

It should create the ISM policy as the index patterns don't overlap

Additional Details

Plugins Please list all plugins currently enabled.

Screenshots If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

Additional context Add any other context about the problem here.

terryquigleysas commented 1 month ago

@rishabhToshniwal Which version of OpenSearch are you seeing this on?

rishabhToshniwal commented 1 month ago

@terryquigleysas its Opensearch 2.3

dblock commented 1 month ago

[Catch All Triage - 1, 2, 3, 4]

dhwanilpatel commented 2 weeks ago

@opensearch-project/admin Since it is ISM related, can we move it to https://github.com/opensearch-project/index-management ?

BEL commented 2 weeks ago

Observing the same issue on 2.9