-
Notifications
You must be signed in to change notification settings - Fork 113
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
[BUG] index rollover - doesn't create all aliases in the newly created index #734
Comments
Thanks for reporting this bug! |
This doesn't seem to be a bug. Like you said, even using rollover API, you need to explicitly define the aliases you want on the new index. If the alias you want to add is a static one, I think maybe index template is what you want https://opensearch.org/docs/latest/im-plugin/index-templates/. You can define the template to add alias to the matched new index. But if it's a dynamic one, like I can see |
@bowenlan-amzn , Thanks. |
I want to clarify our understanding of the term "dynamic" in this context. I use dynamic to mean that the alias changes during rollover. e.g., during index1 w/ alias -> rollover -> index2 w/ alias, some fields in the alias like |
@bowenlan-amzn , Example for index lifecycle:
I hope now it is more clear and that you see why it is a bug and not a new feature. Thank you. |
To move forward, we need to enhance the rollover action https://opensearch.org/docs/latest/im-plugin/ism/policies/#rollover In the code, before executing rollover https://github.com/opensearch-project/index-management/blob/main/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt#L116 @oridool do you want to help implement this function? |
@bowenlan-amzn , Unfortunately I'm not familiar with Kotlin or the Opensearch project specifically, and therefore it won't be effective for me to implement it. Appreciate if you can take it or someone else who is more familiar with this project. Thanks. |
I do not believe that the default setting would be the user's preference. In my understanding, an alias serves as a namespace for a set of indices (index patterns). Therefore, if the user wishes to assign an alias to a newly created index within a specific index pattern, this can be achieved through an index template, as previously proposed. It should also be noted that Rollover is an operation performed on an alias in order to create a new index that also conforms to the specified index pattern (since only the suffix number increases). So in your use case, apart from updating the alias of one index, you can also update the alias in the index template so it works for all the newly created index. Let me know if you see any issues with this approach. |
@bowenlan-amzn , "an alias serves as a namespace" - not exactly, an alias is like a view on the index (if I try to compare OpenSearch to RDBMS). "this can be achieved through an index template" - this is not correct. In index template you can only provide a static pre-configured alias, while some people create the aliases after the index is created or modifying an existing alias filter. Please let's go ahead with what you already offered here: #734 (comment) |
What is the bug?
When using ISM rollover and the index contains multiple aliases, only the alias configured for rollover is created in the new index.
Other aliases existing in original index (before rollover) are not copied.
How can one reproduce the bug?
Steps to reproduce the behavior:
Result:
As you can see, the alias 'anotheralias' is missing from the new index 'rollovertests-000002'.
What is the expected behavior?
The alias 'anotheralias' should be copied to the new index upon rollover.
In fact, all existing aliases with all of their properties (routing, filter,...) should be copied.
The _rollover API supports that by providing the "aliases" part in the body. But the ISM just doesn't call it properly.
As a proof, I can do the rollover manually, and then I get the expected results:
Result:
What is your host/environment?
The text was updated successfully, but these errors were encountered: