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] ISM policies and index templates are constantly updated #833

Open
lpeter91 opened this issue May 31, 2024 · 5 comments
Open

[BUG] ISM policies and index templates are constantly updated #833

lpeter91 opened this issue May 31, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@lpeter91
Copy link

Operator version: 2.6.0

The following very simple ISM template and index template get constantly updated by the operator. (The operator logs "policy exists and requires update" and "Index template requires update" respectively.)

ISM template:

apiVersion: opensearch.opster.io/v1
kind: OpenSearchISMPolicy
metadata:
  name: soc-policy
spec:
  opensearchCluster:
    name: opensearch
  policyId: soc-policy
  description: "SOC ISM policy"
  defaultState: hot
  states:
    - name: hot
      actions:
        - rollover:
            minIndexAge: "14d"
            minPrimaryShardSize: 10gb
          retry:
            count: 3
            backoff: exponential
            delay: 1m
      transitions:
        - stateName: delete
          conditions:
            minRolloverAge: "365d"
    - name: delete
      actions:
        - delete: { }
          retry:
            count: 3
            backoff: exponential
            delay: 1m
  ismTemplate:
    indexPatterns:
      - "logs-*"
      - "probe-*"
    priority: 1000

Index template:

apiVersion: opensearch.opster.io/v1
kind: OpensearchIndexTemplate
metadata:
  name: logs-generic
spec:
  composedOf:
    - soc-ecs-mappings
    - soc-settings
    - soc-mappings
  dataStream: {}
  indexPatterns:
    - logs-*
  name: logs-generic
  opensearchCluster:
    name: opensearch
  priority: 300

Now these are just examples, in reality most (maybe even all) of my ISM policies and index templates are constantly updated. In fact, my component templates also get updated all the time, but that might be fixed by the unreleased #809. (Btw please do a release, without the fix for #801 the operator isn't really usable in a conventional way.)

For the index templates the issue might be with the data stream, to which the default timestamp field is added. But in general it seems to me that this "diffing" approach is very fragile and destined to break over time. Maybe an other way to handle this should be considered, some very vague ideas:

  • Storing (writing back to the K8s resource?) the API representation of the resource
  • Only keeping this diffing as a performance optimization, reducing the log level to debug and increasing the time between reconcile iterations (could be configurable)
@lpeter91 lpeter91 added bug Something isn't working untriaged Issues that have not yet been triaged labels May 31, 2024
@prudhvigodithi
Copy link
Member

[Triage]
I see there is a PR created for this issue #846, thanks @rkthtrifork.
Adding @swoehrl-mw @salyh
Thank you
@getsaurabh02

@prudhvigodithi prudhvigodithi removed the untriaged Issues that have not yet been triaged label Jun 20, 2024
@lpeter91
Copy link
Author

Nice, but please note that #846 only partially addresses this issue. It (supposedly) fixes the issue with ISM templates, but not for index templates.

@cthtrifork
Copy link
Contributor

@lpeter91 We will look at index templates once the approach have been approved.

@lpeter91
Copy link
Author

@swoehrl-mw I think the closing of this issue was premature, since #846 only partially addresses the problems reported, as discussed above.

@swoehrl-mw swoehrl-mw reopened this Aug 22, 2024
@github-project-automation github-project-automation bot moved this from ✅ Done to 🏗 In progress in Engineering Effectiveness Board Aug 22, 2024
@github-actions github-actions bot added the untriaged Issues that have not yet been triaged label Aug 22, 2024
@dblock
Copy link
Member

dblock commented Aug 26, 2024

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

@dblock dblock removed the untriaged Issues that have not yet been triaged label Aug 26, 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
Status: 🏗 In progress
Development

No branches or pull requests

5 participants