-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Conversation
@@ -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`:: |
There was a problem hiding this comment.
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.
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
There was a problem hiding this 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
)
server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesServiceTests.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java
Show resolved
Hide resolved
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.
Relates: elastic/elasticsearch#58100 Co-authored-by: Russ Cam <russ.cam@elastic.co>
Relates: elastic/elasticsearch#58100 Co-authored-by: Russ Cam <russ.cam@elastic.co>
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 <javanna@users.noreply.github.com>
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 <javanna@users.noreply.github.com>
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.