-
Notifications
You must be signed in to change notification settings - Fork 112
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
Allow a dynamic target index in ISM Rollup #61
Comments
Comment by dbbaughe I believe @thalurur just did something similar for snapshot name too. That being said, correct me if I'm wrong Ravi, but if @mark-meyer applies this policy to daily log indices even if they roll up into the same target index they will not overwrite each other. We do support multiple rollups in the same index. Each index that is managed by the policy would have a rollup job created for itself when the rollup action is created which will use its own rollup ID as a namespace in the target index to handle conflicts. And the rollup ID seems to consist of a hash of the job configuration and the source index which will be unique per daily log index. Edit: Do we delete these temporary rollup jobs after they finish @thalurur? |
Comment by thalurur At the moment ISM action will not delete the jobs after they are finished. Rest of the behavior described by Drew is accurate - at the moment the same policy will be creating multiple jobs (based on the source index the policy is being executed on) and all of these jobs writing data to the same target index. And data from each job cannot be touched by other jobs as their namespace includes the rollup job id. Rollup implementation have some constraints imposed at the moment:
The above makes the only way to rollup data for daily log indices is to create one job that writes to one target index. So the rolled up data can be searched together. What happens with current policy: What happens with proposed policy: We have few options if we need to support either:
@mark-meyer Couple of questions:
|
Comment by garlicsauce +1 I was trying to setup rollup policy with target index containing date math expression
Without such possibility I guess I need to create some script running every day that would create rollup jobs itself which is much uglier solution. To sum up - it would be nice to be able to setup a rollup job/rollup policy with dynamic target index. |
opensearch-project#61) * Adds VisualCreatePolicy page, missing backend routes/configs, updates all creation paths to show new modal, updates rates, etc. Signed-off-by: Drew Baugher <[email protected]> * Updates cypress tests Signed-off-by: Drew Baugher <[email protected]> * Fixes cypress test Signed-off-by: Drew Baugher <[email protected]> * Fixes duplicate action type, filters retry/timeout keys, and fixes transition condition default value when switching Signed-off-by: Drew Baugher <[email protected]>
Additional comments:
Main issue being that the target of the rollup is currently static, which means once that target index is too large then you need to manually stop the rollup job and start a new one to point to a new index. We need to be able to have a single continuous rollup job that can write to a target that can change (by using an alias where backing indices are rolled over, maybe data streams, dynamically configured index names, etc). |
To sum up, the ask is
@mark-meyer @garlicsauce does this address your use case? |
@setiah Here is example when using scripted target_index field:
Notice rollover_with_rollup_policy has been added to log-000001. Rollover action will be executed and then rollup action. After executing rollup action, rollup job would create rollup_log-000001 index. |
Scripted target index is complete for mustache templates but still needs support for aliases. There are two clear options I see for alias:
@setiah thoughts? |
@setiah any thoughts on this? |
@petardz, @downsrob - can rollup target_index be mapped to a index alias and can we have a ism policy for that target_index? if we use this method then it would be more powerful and dynamic. i tried to do this.
when i tried to do this in aws opensearch v7.9 the rollup job fails with this error maybe this idea could be a independent issue and not related to this. but i stumpled on this github issue while trying to troubleshoot the above error and felt this would be cleaner approach. |
@JathinSanghvi We don't have currently alias capability in target_index, but your example can be setup through "scripted target_index". Checkout this comment with example: link Regarding alias, if we support it in target_index it would be very similar flow to "scripted target_index" variant:
During creation of the job, if alias doesn't exists, we would create backing index and alias.
Difference between alias variant from "scripted" variant is that with alias you would be able to control separately when rollup index rolls over. In scripted variant rollup index is tied to current source_index and when source_index rolls over then new rollup index is created. |
i feel there wont be additional work required for new variant, just the support for alias on target index should be enough. So then who ever is picking up the alias work should leave it to be flexible so that both variants can exist side by side. what do you think? |
@petardz Can you help me with the following: https://forum.opensearch.org/t/searching-multiple-rollup-indexes-not-working/21582 |
Issue by mark-meyer
Wednesday Mar 31, 2021 at 00:46 GMT
Originally opened as opendistro-for-elasticsearch/index-management#428
I would like to apply a policy to daily log indices that performs a rollup in one of the states before deleting the index. However is seem the
target_index
requires a string and there is no option to interpolate something like{{ctx.index}}
or similar. This makes it impossible to apply this policy to more than one index unless you are okay with rollup overwriting the previous one, which you probably aren't.Describe the solution you'd like
I would like to specify the
target_index
field of an ism rollup dynamically based on the name (or some other metadata) of the index being rolled up such as"target_index": "rollup_{{ctx.index}}"
The text was updated successfully, but these errors were encountered: