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

Avoiding deleting SLM history indices in rest test case cleanup #100694

Conversation

masseyke
Copy link
Member

If an SLM policy happens to run during a rest test, an slm history index will be created, which then causes a failure during test cleanup like:

org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT > test {yaml=reference/query-dsl/simple-query-string-query/line_291} FAILED
    org.elasticsearch.client.ResponseException: method [DELETE], host [http://127.0.0.1:43027], URI [*,-.ds-ilm-history-*?expand_wildcards=open%2Cclosed%2Chidden], status line [HTTP/1.1 400 Bad Request]
    {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"index [.ds-.slm-history-5-2023.10.09-000001] is the write index for data stream [.slm-history-5] and cannot be deleted"}],"type":"illegal_argument_exception","reason":"index [.ds-.slm-history-5-2023.10.09-000001] is the write index for data stream [.slm-history-5] and cannot be deleted"},"status":400}
        at __randomizedtesting.SeedInfo.seed([E12124F261F0BF90:69751B28CF0CD268]:0)
        at app//org.elasticsearch.client.RestClient.convertResponse(RestClient.java:347)
        at app//org.elasticsearch.client.RestClient.performRequest(RestClient.java:313)
        at app//org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)
        at app//org.elasticsearch.test.rest.ESRestTestCase.wipeAllIndices(ESRestTestCase.java:981)
        at app//org.elasticsearch.test.rest.ESRestTestCase.wipeCluster(ESRestTestCase.java:729)
        at app//org.elasticsearch.test.rest.ESRestTestCase.cleanUpCluster(ESRestTestCase.java:421)
        at java.base@21/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base@21/java.lang.reflect.Method.invoke(Method.java:580)
        at app//com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)

This PR excludes the SLM history index from deletion the same way we exclude the ILM history index.

Closes #100536

@masseyke masseyke added >test Issues or PRs that are addressing/adding tests :Data Management/ILM+SLM Index and Snapshot lifecycle management v8.12.0 labels Oct 11, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Oct 11, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM also, thanks for fixing this

@masseyke
Copy link
Member Author

@elasticmachine update branch

@masseyke masseyke added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Oct 11, 2023
@elasticsearchmachine elasticsearchmachine merged commit bd4d45a into elastic:main Oct 11, 2023
@masseyke masseyke deleted the do-not-delete-slm-history-indices-in-rest-tests branch October 11, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team >test Issues or PRs that are addressing/adding tests v8.12.0
Projects
None yet
4 participants