Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Existing indices are not assigned new ISM Policies #264

Closed
fgendc opened this issue Feb 10, 2022 · 1 comment
Closed

[BUG] Existing indices are not assigned new ISM Policies #264

fgendc opened this issue Feb 10, 2022 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@fgendc
Copy link

fgendc commented Feb 10, 2022

Describe the bug
Adding an ISM policy with an index pattern doesn't assign existing indices to the policy.
According to the documentation here states in point 6 that's not the expected behavior.

To Reproduce
Steps to reproduce the behavior:

  1. Create index 'default-1'
    curl -XPUT http://localhost:9200/default-1 -d '{ "settings": { "index": { "number_of_shards": 2, "number_of_replicas": 1 } }, "mappings": { "properties": { "age": { "type": "integer" } } }, "aliases": { "sample-alias1": {} } }' -H "Content-Type: application/json"
  2. On Dashboards, create new ISM Policy with ISM template and index_pattern "default-*"
  3. Index is not assigned the Policy and doesn't appear in the Managed Index section in Dashboards.
  4. Create index 'default-2'
    curl -XPUT http://localhost:9200/default-2 -d '{ "settings": { "index": { "number_of_shards": 2, "number_of_replicas": 1 } }, "mappings": { "properties": { "age": { "type": "integer" } } }, "aliases": { "sample-alias1": {} } }' -H "Content-Type: application/json"
  5. default-1 isn't assigned the policy, but default-2 has it.

Expected behavior
default-1 index matches the pattern defined in the ISM template section of the policy and should be assigned the policy after creating it.

Plugins

  • opensearch-alerting
  • opensearch-anomaly-detection
  • opensearch-asynchronous-search
  • opensearch-cross-cluster-replication
  • opensearch-index-management
  • opensearch-job-scheduler
  • opensearch-knn
  • opensearch-observability
  • opensearch-performance-analyzer
  • opensearch-reports-scheduler
  • opensearch-security
  • opensearch-sql
  • repository-s3

Desktop (please complete the following information):

  • OS: MacOS
  • Version 12.2

Additional context
Installed on Kubernetes using Helm for both OpenSearch (1.2.4) and OpenSearch Dashboards (1.2.0), with Security Plugin disabled.

@fgendc fgendc added Beta bug Something isn't working untriaged labels Feb 10, 2022
@bowenlan-amzn
Copy link
Member

ISM template only works for indices created afterwards.

But you can hack it to manage earlier created index by changing the last_updated_time of ism_template to an earlier time epoch.

ism_template: {
  index_patterns: ...
  priority: ...
  last_updated_time: <earlier time epoch>
}

@bowenlan-amzn bowenlan-amzn added help wanted Extra attention is needed and removed bug Something isn't working Beta untriaged labels Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants