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 Search Applications bug where deleting an alias before deleting an application intermittently caused errors #106329

Merged

Conversation

kderusso
Copy link
Member

There is an intermittent error when deleting search applications, where if the alias has been removed the search application deletion call can fail with an alias not found error.

To reproduce:

PUT example-index

PUT _application/search_application/test-sa
{
  "indices": ["example-index"]
}

POST _aliases
{
  "actions": [
    {
      "remove": {
        "index": "example-index",
        "alias": "test-sa"
      }
    }
  ]
}

DELETE _application/search_application/test-sa

It appears there is a race condition. Sometimes this returns an acknowledged response but other times it returns the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "aliases_not_found_exception",
        "reason": "aliases [test-sa] missing",
        "resource.type": "aliases",
        "resource.id": "test-sa"
      }
    ],
    "type": "aliases_not_found_exception",
    "reason": "aliases [test-sa] missing",
    "resource.type": "aliases",
    "resource.id": "test-sa"
  },
  "status": 404
}

This PR addresses this.

@elasticsearchmachine
Copy link
Collaborator

Hi @kderusso, I've created a changelog YAML for you.

@kderusso kderusso changed the title Update delete object to never fail if alias does not exist Fix Search Applications bug where deleting an alias before deleting an application intermittently caused errors Mar 13, 2024
@kderusso kderusso marked this pull request as ready for review March 13, 2024 20:42
@kderusso kderusso requested review from a team and carlosdelest March 13, 2024 20:42
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-relevance (Team:Search - Relevance)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ent-search-eng (Team:SearchOrg)

Copy link
Contributor

@demjened demjened left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@carlosdelest carlosdelest left a comment

Choose a reason for hiding this comment

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

👍

@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.13

kderusso added a commit to kderusso/elasticsearch that referenced this pull request Mar 14, 2024
…n application intermittently caused errors (elastic#106329)

* Update delete object to never fail if alias does not exist

* Update docs/changelog/106329.yaml

* Update changelog

* Fix area in changelog
elasticsearchmachine pushed a commit that referenced this pull request Mar 14, 2024
…n application intermittently caused errors (#106329) (#106354)

* Update delete object to never fail if alias does not exist

* Update docs/changelog/106329.yaml

* Update changelog

* Fix area in changelog
@kderusso kderusso deleted the kderusso/bugfix-delete-search-app-missing-alias branch July 8, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :SearchOrg/Relevance Label for the Search (solution/org) Relevance team v8.13.1 v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants