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] Policy deletes indices too early #1074

Open
torbenaa opened this issue Jan 17, 2024 · 1 comment
Open

[BUG] Policy deletes indices too early #1074

torbenaa opened this issue Jan 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@torbenaa
Copy link

torbenaa commented Jan 17, 2024

Describe the bug

State management policy deletes indices too early, ignoring the 120 days (120d) specified on the policy step.

Related component

Other

To Reproduce

Create the index policy :

PUT _plugins/_ism/policies/production-log-policy
{
  "policy" : {
    "policy_id" : "production-log-policy",
    "description" : "Delete after 4 month.",
    "default_state" : "hot",
    "states" : [
      {
        "name" : "hot",
        "actions" : [
          {
            "retry" : {
              "count" : 3,
              "backoff" : "exponential",
              "delay" : "1m"
            },
            "index_priority" : {
              "priority" : 100
            }
          }
        ],
        "transitions" : [
          {
            "state_name" : "warm",
            "conditions" : {
              "min_index_age" : "14d"
            }
          }
        ]
      },
      {
        "name" : "warm",
        "actions" : [
          {
            "retry" : {
              "count" : 3,
              "backoff" : "exponential",
              "delay" : "1m"
            },
            "index_priority" : {
              "priority" : 50
            }
          }
        ],
        "transitions" : [
          {
            "state_name" : "delete",
            "conditions" : {
              "min_index_age" : "120d"
            }
          }
        ]
      },
      {
        "name" : "delete",
        "actions" : [
          {
            "retry" : {
              "count" : 3,
              "backoff" : "exponential",
              "delay" : "1m"
            },
            "delete" : { }
          }
        ],
        "transitions" : [ ]
      }
    ],
    "ism_template" : [
      {
        "index_patterns" : [
          "logstash-xxx-prod*"
        ],
        "priority" : 1
      }
    ]
  }
}

Expected behavior

I would expect the indices to go into "warm" state after 14 days, and then after 120d be deleted.
The policy deletes all matching indices after 14 days !

Additional Details

Running Opensearch 3-node cluster on Kubernetes based on the ofiicial helm charts.

Helm chart version is opensearch-2.17.2
Opensearch version is 2.11

@torbenaa torbenaa added bug Something isn't working untriaged labels Jan 17, 2024
@peternied peternied transferred this issue from opensearch-project/OpenSearch Jan 17, 2024
@dblock
Copy link
Member

dblock commented Jun 17, 2024

Looks like a bug.

Catch All Triage - 1 2 3 4 5

@dblock dblock removed the untriaged label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants