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

Fix delete index template failed when the index template matches a data stream but is unused #15080

Merged
merged 5 commits into from
Aug 3, 2024

Conversation

gaobinlong
Copy link
Collaborator

@gaobinlong gaobinlong commented Aug 2, 2024

Description

Index templates without a explicit data_stream attribute cannot be used by data stream actually, but when deleting an ordinary index template which is not used by any data stream, if the index patterns match a data stream, then the delete operation fails with an exception unable to remove composable templates [test] as they are in use by a data streams [test]. This PR fixes the bug and add some test code.

Related Issues

Resolves #9194

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…ches a data stream

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
@gaobinlong gaobinlong added the backport 2.x Backport to 2.x branch label Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 7e47732: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 1212877: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 1212877: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@gaobinlong
Copy link
Collaborator Author

@reta @dblock @andrross could you help to review this PR, thank you!

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 1212877: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 1212877: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 3dea93d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 3dea93d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 3dea93d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Aug 2, 2024

❌ Gradle check result for 3dea93d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Copy link
Contributor

github-actions bot commented Aug 3, 2024

❌ Gradle check result for 1c0bd1c: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Aug 3, 2024

❕ Gradle check result for f092892: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Aug 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.88%. Comparing base (48634bd) to head (f092892).
Report is 3 commits behind head on main.

Files Patch % Lines
...cluster/metadata/MetadataIndexTemplateService.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #15080      +/-   ##
============================================
+ Coverage     71.82%   71.88%   +0.05%     
- Complexity    62778    62818      +40     
============================================
  Files          5169     5169              
  Lines        294646   294665      +19     
  Branches      42610    42616       +6     
============================================
+ Hits         211644   211834     +190     
+ Misses        65573    65419     -154     
+ Partials      17429    17412      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@reta reta merged commit a9d09aa into opensearch-project:main Aug 3, 2024
32 of 34 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 3, 2024
…ta stream but is unused (#15080)

* Fix delete not-using index template failed when the index pattern matches a data stream

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify change log

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Fix version check

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
(cherry picked from commit a9d09aa)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta added a commit that referenced this pull request Aug 3, 2024
…te matches a data stream but is unused (#15098)

* Fix delete index template failed when the index template matches a data stream but is unused (#15080)

* Fix delete not-using index template failed when the index pattern matches a data stream

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify change log

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Fix version check

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
(cherry picked from commit a9d09aa)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update 10_basic.yml to for 2.17.0

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
harshavamsi pushed a commit to harshavamsi/OpenSearch that referenced this pull request Aug 20, 2024
…ta stream but is unused (opensearch-project#15080)

* Fix delete not-using index template failed when the index pattern matches a data stream

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify change log

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Fix version check

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
wdongyu pushed a commit to wdongyu/OpenSearch that referenced this pull request Aug 22, 2024
…ta stream but is unused (opensearch-project#15080)

* Fix delete not-using index template failed when the index pattern matches a data stream

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify change log

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Fix version check

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Sep 10, 2024
…ta stream but is unused (opensearch-project#15080)

* Fix delete not-using index template failed when the index pattern matches a data stream

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify change log

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Fix version check

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch bug Something isn't working :Feature/Datastream Issues related to data streams v2.17.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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