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

Add new flag to check whether alias exists on remove #58100

Merged
merged 4 commits into from
Jun 18, 2020

Conversation

ywelsch
Copy link
Contributor

@ywelsch ywelsch commented Jun 15, 2020

This allows doing true CAS operations on aliases, making sure that an alias is actually properly moved from a given source index onto a given target index. This is useful to ensure that an alias is actually moved from a given index to another one, and not just added to another index.

@@ -113,6 +113,10 @@ unless overriden in the request using the `expand_wildcards` parameter,
similar to <<index-hidden,hidden indices>>. This property must be set to the
same value on all indices that share an alias. Defaults to `false`.

`must_exist`::
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not sure about the naming here. Initially I went with "required", but I felt that that was a bit too generic, so opted for a word where it's at least clear what is meant.

@ywelsch ywelsch added :Data Management/Indices APIs APIs to create and manage indices and templates >enhancement v7.9.0 v8.0.0 labels Jun 16, 2020
@ywelsch ywelsch marked this pull request as ready for review June 16, 2020 13:09
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Jun 16, 2020
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM. I left testing nits.
Regarding the name of the new flag, I think must_exist is good.
(I can't think of a better name and it is more descriptive than required)

@ywelsch ywelsch merged commit b305454 into elastic:master Jun 18, 2020
ywelsch added a commit that referenced this pull request Jun 18, 2020
This allows doing true CAS operations on aliases, making sure that an alias is actually properly
moved from a given source index onto a given target index. This is useful to ensure that an
alias is actually moved from a given index to another one, and not just added to another index.
ywelsch added a commit that referenced this pull request Jun 18, 2020
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Aug 4, 2020
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Aug 4, 2020
github-actions bot pushed a commit to elastic/elasticsearch-net that referenced this pull request Aug 4, 2020
github-actions bot pushed a commit to elastic/elasticsearch-net that referenced this pull request Aug 4, 2020
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Aug 5, 2020
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Aug 5, 2020
henningandersen added a commit to henningandersen/elasticsearch that referenced this pull request Nov 17, 2020
Remove alias now parses the must_exist flag and results in a 404
(not found), if the index does not have the alias.

Closes elastic#62642
Relates elastic#58100

Co-Authored-By: Luca Cavanna <[email protected]>
henningandersen added a commit that referenced this pull request Nov 18, 2020
Remove alias now parses the must_exist flag and results in a 404
(not found), if the index does not have the alias.

Closes #62642
Relates #58100

Co-Authored-By: Luca Cavanna <[email protected]>
henningandersen added a commit to henningandersen/elasticsearch that referenced this pull request Nov 18, 2020
Remove alias now parses the must_exist flag and results in a 404
(not found), if the index does not have the alias.

Closes elastic#62642
Relates elastic#58100

Co-Authored-By: Luca Cavanna <[email protected]>
henningandersen added a commit that referenced this pull request Nov 18, 2020
Remove alias now parses the must_exist flag and results in a 404
(not found), if the index does not have the alias.

Closes #62642
Relates #58100

Co-Authored-By: Luca Cavanna <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement Team:Data Management Meta label for data/management team v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants