-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Adds a new Rollup Action #64900
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
Adds a new Rollup Action #64900
Conversation
|
Pinging @elastic/es-analytics-geo (:Analytics/Rollup) |
62b76a5 to
be90dd3
Compare
|
run elasticsearch-ci/2 |
|
For the reviewers @csoulios and @not-napoleon, I am still working on making more of the indexer logic unit-testable. I would love some feedback on the general process and any large gotchyas you may see. There is a lot of state change and index dancing. I do intend to make these parts a bit more resilient, but that may not be a part of this PR pending further discussion! thanks! |
This commit adds a new endpoint for Rollup V2, a new way to rollup indices.
Instead of relying on a cron-job, this action will rollup a whole index on the spot.
When an index is rolled up using a Rollup Config, it does the following
1. check that original index is read-only
2. runs an aggregation and indexes results into a temporary hidden rollup index
3. "resizes" the temporary index into the final rollup-index (in-place segment pointer juggling)
4. adds RollupMetadata about the rollup-group (keyed by original index name) and adds custom index-metadata with data about what the rollup index's original index is so that its group information in RollupMetadata can be looked up
example usage:
```
POST /_rollup_vtwo/index
{
"rollup_index": "index_rolled",
"groups": {
"date_histogram": {
"field": "date",
"calendar_interval": "1M"
},
"terms": {
"fields": ["unit"]
}
},
"metrics": [
{
"field": "temperature",
"metrics": ["sum"]
}
]
}
```
be90dd3 to
1a3e115
Compare
not-napoleon
left a comment
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.
I left a few thoughts, but I don't think any of them are blockers to merging.
server/src/main/java/org/elasticsearch/cluster/ClusterModule.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/v2/RollupV2Action.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/v2/RollupV2Action.java
Outdated
Show resolved
Hide resolved
...k/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupV2Action.java
Outdated
Show resolved
Hide resolved
This commit adds a new endpoint for Rollup V2, a new way to rollup indices.
Instead of relying on a cron-job, this action will rollup a whole index on the spot.
When an index is rolled up using a Rollup Config, it does the following
1. check that original index is read-only
2. runs an aggregation and indexes results into a temporary hidden rollup index
3. "resizes" the temporary index into the final rollup-index (in-place segment pointer juggling)
4. adds RollupMetadata about the rollup-group (keyed by original index name) and adds
custom index-metadata with data about what the rollup index's original index is so that its
group information in RollupMetadata can be looked up
example usage:
```
POST /_rollup_vtwo/index
{
"rollup_index": "index_rolled",
"groups": {
"date_histogram": {
"field": "date",
"calendar_interval": "1M"
},
"terms": {
"fields": ["unit"]
}
},
"metrics": [
{
"field": "temperature",
"metrics": ["sum"]
}
]
}
```
relates elastic#42720.
This commit adds a new endpoint for Rollup V2, a new way to rollup indices.
Instead of relying on a cron-job, this action will rollup a whole index on the spot.
When an index is rolled up using a Rollup Config, it does the following
1. check that original index is read-only
2. runs an aggregation and indexes results into a temporary hidden rollup index
3. "resizes" the temporary index into the final rollup-index (in-place segment pointer juggling)
4. adds RollupMetadata about the rollup-group (keyed by original index name) and adds
custom index-metadata with data about what the rollup index's original index is so that its
group information in RollupMetadata can be looked up
example usage:
```
POST /_rollup_vtwo/index
{
"rollup_index": "index_rolled",
"groups": {
"date_histogram": {
"field": "date",
"calendar_interval": "1M"
},
"terms": {
"fields": ["unit"]
}
},
"metrics": [
{
"field": "temperature",
"metrics": ["sum"]
}
]
}
```
relates #42720.
This PR implements downsampling operation on time series indices.
The PR creates a _rollup endpoint that allows users to downsample an index and can be
accessed by the following call:
POST /<source_index>/_rollup/<rollup_index>
{
"fixed_interval": "1d"
}
Requirements
An index can be downsampled if all of the following requirements are met:
Must be a time series index (have the index.mode: time_series index setting)
Must not be writeable (have the index.blocks.write: true index setting)
Must have dimension fields marked with mapping parameter time_series_dimension: true
Must have metric fields marked with mapping parameter time_series_metric
Relates to #74660
Fixes #65769
Fixes #69799
Finally, this PR is based on the code written for #64900
This PR implements downsampling operation on time series indices.
The PR creates a _rollup endpoint that allows users to downsample an index and can be
accessed by the following call:
POST /<source_index>/_rollup/<rollup_index>
{
"fixed_interval": "1d"
}
Requirements
An index can be downsampled if all of the following requirements are met:
Must be a time series index (have the index.mode: time_series index setting)
Must not be writeable (have the index.blocks.write: true index setting)
Must have dimension fields marked with mapping parameter time_series_dimension: true
Must have metric fields marked with mapping parameter time_series_metric
Relates to elastic#74660
Fixes elastic#65769
Fixes elastic#69799
Finally, this PR is based on the code written for elastic#64900
This commit adds a new endpoint for Rollup V2, a new way to rollup indices.
Instead of relying on a cron-job, this action will rollup a whole index on the spot.
When an index is rolled up using a Rollup Config, it does the following
example usage: