[8.19] Bug fix: the filter of a data stream alias is not always properly removed. (#139679)#139691
Merged
elasticsearchmachine merged 1 commit intoelastic:8.19from Dec 17, 2025
Merged
Conversation
…oved. (elastic#139679) A data stream alias that has more than 1 data stream does not handle correctly the removal of a filtered data stream alias. It currently retains the filter even after the alias is removed. ``` # Create 2 data streams PUT _data_stream/logs-yyy-default PUT _data_stream/logs-xxx-default # Add a filtered alias to one and a simple alias to the other. POST _aliases { "actions": [ { "add": { "index": "logs-yyy-default", "alias": "myalias", "filter": { "term": { "type": "mytype" } } } }, { "add": { "index": "logs-xxx-default", "alias": "myalias" } } ] } # Remove the filtered alias POST _aliases { "actions": [ { "remove": { "index": "logs-yyy-default", "alias": "myalias" } } ] } # Add back the alias but WITHOUT filter POST _aliases { "actions": [ { "add": { "index": "logs-yyy-default", "alias": "myalias" } } ] } ``` The last alias will contain the initial filter while it should not. This PR fixes that. Furthermore, we edit the update and removal of data streams from an alias to be able to handle orphaned aliases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports the following commits to 8.19: