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.
Signed-off-by: Drew Baugher 46505179+dbbaughe@users.noreply.github.com
Issue #, if available:
#35
Description of changes:
Adds support for an alias action in ISM.
Gives complete support for all update alias API options by reusing the alias actions parser internally and explicitly not defining the mappings in our config index.
Coming from the GitHub feature request, the use cases people asked for:
1.1. As of right now I don't believe this would be doable because we do not know the name of the source index that was used to shrink to this target index. To do so we need to update core to store this information in the IndexMetadata when the shrink operation is performed. This theoretically should be doable though once we release the Shrink action.. in a roundabout kind of way. Essentially once ISM shrinks
foo-index
tofoo-index-shrink
there will be two jobs running. One forfoo-index
and one forfoo-index-shrink
. If we knew what the source index of the shrink was onfoo-index-shrink
thenfoo-index-shrink
could call the update alias API and delete thefoo-index
and add that as an alias to itself in a single API call I believe. Since that's not possible for now.. then going the other way thefoo-index
after it successfully executes the Shrink action should be able to do the same thing, it can call the update alias API and delete itself while also setting an alias on thefoo-index-shrink
equal to it's own index name.1.2
2.1 I'm assuming this is similar to (1) because I don't believe you can add an alias that is a concrete index. So you would need to delete the
foo
index in this example. So if it's the same as (1) then yes, there would be a way once we support Shrink action.3.1 Should be similar to previous cases where the job that performs the rollup would have to then go and update the target index to have aliases of the source index patterns. The downside being I don't believe this specific policy would be that reusable.. and it wouldn't be possible to go the other way, i.e. a target rollup index comes into being and starts being managed and then figures out which indices it was rolled up from (we might actually store that information in the meta mappings of the rollup target index, so it could be doable in the future). Or if the source index has a wildcard pattern like
log*
then when updating the alias for the target index.. we can't use that and would have to resolve to concrete indices which could be old or become stale.4.1. This should be easily doable with the Alias action, just have a state that gets transitioned into after the index is 30 days old (or 30 days rollover age) and then remove the alias.
5.1 Should be possible, the newly created index can remove the alias from all search-index-* indices and then add the alias it itself in a single call. The main thing would be knowing when ingestion finished for the new index.. which you could just use some absolute time using the transition condition if you know it only takes x amount of time.
CheckList:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.