Skip to content

[BUG] DataStreams: Can't delete index template that matches the data stream but is unused #9194

Closed
@Jakob3xD

Description

@Jakob3xD

Describe the bug
It is not possible to delete an index template matching a data stream that is not used by the data stream.

To Reproduce
Steps to reproduce the behavior:
1.

PUT _index_template/test
{
  "index_patterns": [
    "test*"
  ],
  "template": {},
  "composed_of": [],
  "priority": 50
}
PUT _index_template/test-data-stream
{
  "index_patterns": [
    "test"
  ],
  "data_stream": {},
  "template": {},
  "composed_of": [],
  "priority": 51
}
  1. PUT _data_stream/test
  2. DELETE _index_template/test
  3. Get following error:
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "unable to remove composable templates [test] as they are in use by a data streams [test]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unable to remove composable templates [test] as they are in use by a data streams [test]"
  },
  "status": 400
}

Expected behavior
It should be possible to delete the index template as it is not used.

Plugins

opensearch-alerting
opensearch-anomaly-detection
opensearch-asynchronous-search
opensearch-cross-cluster-replication
opensearch-geospatial
opensearch-index-management
opensearch-job-scheduler
opensearch-knn
opensearch-ml
opensearch-neural-search
opensearch-notifications
opensearch-notifications-core
opensearch-observability
opensearch-reports-scheduler
opensearch-security
opensearch-security-analytics
opensearch-sql
prometheus-exporter
repository-s3

Host/Environment (please complete the following information):

  • Setup: Docker on Ubuntu
  • Opensearch: v2.8.0

Additional information:
elastic/elasticsearch#84376

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Feature/DatastreamIssues related to data streamsbugSomething isn't workingv2.17.0v3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions