-
Notifications
You must be signed in to change notification settings - Fork 130
Adding support for multi-tier rollups in ISM #1533
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
Adding support for multi-tier rollups in ISM #1533
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1533 +/- ##
==========================================
+ Coverage 76.17% 76.31% +0.14%
==========================================
Files 375 375
Lines 17596 17806 +210
Branches 2417 2459 +42
==========================================
+ Hits 13404 13589 +185
- Misses 2947 2962 +15
- Partials 1245 1255 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9a7bc1a to
b5e5ad8
Compare
...main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupFieldValueExpressionResolver.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt
Outdated
Show resolved
Hide resolved
| dimensionsList.toList() | ||
| }, | ||
| metrics = sin.readList(::RollupMetrics), | ||
| sourceIndex = if (sin.version.onOrAfter(Version.V_3_0_0) && sin.readBoolean()) { |
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.
This change is targetted for version 3.5 right ?
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.
Actually version 3.5 is yet not available as we are yet to upgrade, hence had kept this as a placeholder
| } | ||
| } | ||
| out.writeCollection(metrics) | ||
| if (out.version.onOrAfter(Version.V_3_0_0)) { |
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.
version check should be 3.5
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.
Correct, but actually version 3.5 is yet not available as we are yet to upgrade, hence had kept this as a placeholder
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.
Will add a TODO comment for now highlighting the required version check upgrade once 3.5 is available
...rg/opensearch/indexmanagement/indexstatemanagement/step/rollup/AttemptCreateRollupJobStep.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataService.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt
Outdated
Show resolved
Hide resolved
c266f5b to
88a3169
Compare
src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupMapperService.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
…orm multi-tier rollups Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
37b619f to
0a8d5f3
Compare
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
|
Thanks @soosinha for reviewing. Merging the PR for now, will update the version check once the 3.5 version upgrade PR is merged. |
|
@tandonks I notice the IT added in this PR slow down the ism test suite by around 2m and starting to cause timeout for the checks in other PRs (limit is 20m for now). Compare the time in the PR before It seems to be this one src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupActionIT.kt Please see if you can improve the time cost there. It's better to keep one happy path as IT and use unit test to cover other scenarios. |
Description
This PR implements multi-tier rollup functionality in OpenSearch Index Management, enabling hierarchical data aggregations where rollup indices can serve as source indices for subsequent rollup operations. This allows for progressive data summarization (e.g., raw data → 1-minute → 5-minute → 10-minute intervals) within a single ISM policy or through chained rollup jobs.
Previously, the ISM Rollup action was a terminal operation that only supported rolling up raw indices. This limitation forced users to rely on complex external automation chains (
Raw Data → Rollup → _reindex → Second Rollup Job) or redundantly roll up raw data multiple times at different granularities, leading to:Solution Overview
This implementation extends the rollup framework to support multi-level rollups by:
date_histogramfield instead of scanning raw documentspassenger_count→passenger_count.sum)source_indexfield to ISMRollup schema, enabling explicit source specification for multi-tier chaining{{ctx.index}},{{ctx.source_index}}) for dynamic index naming in ISM policiesLimitations and Best Practices
Source Index Lifecycle Management
When using multi-tier rollups within a single ISM policy, the source index (raw data or intermediate rollup) remains under the same policy's control throughout the entire lifecycle. If you need to delete or manage intermediate rollup indices independently before the policy completes, consider these approaches:
{ "index_patterns": ["my_index_rollup_1m-*"], "template": { "settings": { "plugins.index_state_management.policy_id": "rollup_1m_to_5m_policy" } } }This allows each rollup index to have its own retention and deletion schedule independent of the source data.
Chained Rollup Jobs: Use standalone rollup jobs (outside ISM) for multi-tier scenarios where you need fine-grained control over each tier's lifecycle.
Policy Transitions: Design your ISM policy states carefully to ensure rollup operations complete before any deletion actions are triggered on source indices.
Note: Deleting a source rollup index while a downstream rollup job is still processing it will cause the downstream rollup to fail. Always ensure rollup operations complete before removing source indices.
Example Policy
Related Issues
Resolves #1490
Check List
--signoff.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.