-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
TSDB: Implement downsampling on time-series indices #85708
Merged
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
94fb431
Remove feature flag es.rollup_v2_feature_flag_enabled
csoulios b8e9d2b
RollupShardIndexer
csoulios 7b7d06b
Cleanup
csoulios 75ce70c
Test should not merge segments
csoulios 98627b1
Refactoring code
csoulios 3215864
Fix wrong timestamp order
csoulios 34f42bd
Cleanup
csoulios 29bc089
Cleanup
csoulios 939a1c0
Removed CompressingOfflineSorter implementation
csoulios 23d39a8
class to record
csoulios 0f40815
Added more tests
csoulios 7a44a68
Refactored rollup action config
csoulios b94e82d
Refactored rollup action config
csoulios e514fbb
Update docs/changelog/85708.yaml
csoulios 219da73
Version updates
csoulios 1a385e7
CI Fixes
csoulios 633abac
checkstyle
csoulios d4daeb8
checkstyle
csoulios 496e00f
Skip some failing tests
csoulios 5a0642c
Fix broken test with wrong index sort order
csoulios d0222f0
Fix ILM test
csoulios b8bdcf9
Merge branch 'master' into tsdb-rollup
csoulios d9c6f6e
Enable test
csoulios ff864f2
Update docs/changelog/85708.yaml
csoulios 0464806
Merge branch 'master' into tsdb-rollup
csoulios 643962f
Pull timestamp from AggregationExecutionContext
csoulios d905038
Remove time_zone param from rollup config
csoulios 29b77bc
Fix build failure
csoulios 6237029
Merge branch 'master' into tsdb-rollup
csoulios a3e3e42
Added validations for rollup request parameters
csoulios 0abece8
Update docs/changelog/85708.yaml
csoulios 5dc065c
Set the number of shards and replicas
csoulios 6a8976a
Validate that index is read-only before rolling up
csoulios d6adb3c
Delete source index after it has been downsampled
csoulios 4492090
Added test and fix for rolling up data stream idx
csoulios fc255f6
minor change
csoulios 2bc4600
More changes
csoulios b10254d
Set max as default_metric for gauge metrics
csoulios 405915b
Merge branch 'master' into tsdb-rollup
csoulios d5de1aa
Minor change to address reviewer comments
csoulios bef7341
Tidy up code for data streams
csoulios af006e4
Changed hashCode
csoulios a1988a9
Merge branch 'master' into tsdb-rollup
csoulios cd23fd7
Return statement after error:
csoulios 7973ca2
Merge branch 'master' into tsdb-rollup
csoulios 98fd352
Merge branch 'master' into tsdb-rollup
csoulios c46b126
Fix compilation error
csoulios fb064c6
Merge branch 'master' into tsdb-rollup
csoulios 3167f92
Merge branch 'master' into tsdb-rollup
csoulios ed94943
Fix broken test
csoulios 48796c2
Merge branch 'master' into tsdb-rollup
csoulios 78d110b
Merge branch 'master' into tsdb-rollup
csoulios f41343b
Compute last_value for metric fields
csoulios 286cdbd
Removed temporary rollup index
csoulios ab1a4d8
Refresh the rollup index in the end
csoulios c22b6ba
Use randomValueOtherThan
csoulios 4327b17
Do not serialize constants in RollupActionConfig
csoulios 86c3347
Add tsdb feature flag
csoulios ed51704
Merge branch 'master' into tsdb-rollup
csoulios 22a7589
minor change
csoulios ee42ef5
Perform the following actions in one state update:
csoulios d7d9b72
Perform batched cluster state update
csoulios 332bef6
Cleanup the mess
csoulios 17eb72b
Merge branch 'master' into tsdb-rollup
csoulios 550a368
More cleanup
csoulios 270ea69
Added feature flag to security tests
csoulios 7197a5f
Added feature flag to build files
csoulios 8b96364
Reverted wrong version bump
csoulios 839a29d
Add the number of indexed docs to the shard response
csoulios de6b766
Added javadoc
csoulios 0f3f827
Merge branch 'master' into tsdb-rollup
csoulios 0ff80dc
Changes to rollup index:
csoulios 7c4c441
Remove org.elasticsearch.rollup from module-info
csoulios 5856f1d
Merge branch 'master' into tsdb-rollup
csoulios 1dd28fd
Added more validation for source index
csoulios 393d7c2
Do not fail rollup if force-merge fails
csoulios bfd9ce9
Merge branch 'master' into tsdb-rollup
csoulios 0a06f41
Merge branch 'master' into tsdb-rollup
csoulios File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
*/ | ||
package org.elasticsearch.xpack.rollup.v2; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.elasticsearch.ElasticsearchException; | ||
import org.elasticsearch.action.ActionListener; | ||
import org.elasticsearch.action.admin.indices.create.CreateIndexClusterStateUpdateRequest; | ||
|
@@ -76,6 +78,8 @@ | |
*/ | ||
public class TransportRollupAction extends AcknowledgedTransportMasterNodeAction<RollupAction.Request> { | ||
|
||
private static final Logger logger = LogManager.getLogger(TransportRollupAction.class); | ||
|
||
private final Client client; | ||
private final ClusterService clusterService; | ||
private final MetadataCreateIndexService metadataCreateIndexService; | ||
|
@@ -259,6 +263,8 @@ protected void masterOperation( | |
refreshIndex(rollupIndexName, parentTask, ActionListener.wrap(refreshIndexResponse -> { | ||
if (refreshIndexResponse.getFailedShards() == 0) { | ||
// 6. Add rollup index to data stream and publish rollup metadata | ||
// 7. Mark rollup index as "completed successfully" | ||
// 8. Delete the source index | ||
updateRollupMetadata(sourceIndexName, rollupIndexName, request, ActionListener.wrap(resp -> { | ||
if (resp.isAcknowledged()) { | ||
// 9. Force-merge the rollup index to a single segment | ||
|
@@ -267,12 +273,19 @@ protected void masterOperation( | |
parentTask, | ||
ActionListener.wrap( | ||
mergeIndexResp -> listener.onResponse(AcknowledgedResponse.TRUE), | ||
e -> listener.onFailure( | ||
new ElasticsearchException( | ||
"Failed to force-merge index [" + rollupIndexName + "]", | ||
e -> { | ||
/* | ||
* At this point rollup has been successful even if force-merge fails. | ||
* Also, we have deleted the source index and there is no way we can | ||
* roll back and restart the operation. So, we should not fail the rollup | ||
* operation. | ||
*/ | ||
logger.error( | ||
"Failed to force-merge rollup index [" + rollupIndexName + "]", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 It's probably worth a test that fails here and makes sure we don't fall over. I think this will do the job but it's probably worth tracing this path. Both as a "for now" thing and to make sure that changes in the future don't cause us to lose this property. |
||
e | ||
) | ||
) | ||
); | ||
listener.onResponse(AcknowledgedResponse.TRUE); | ||
} | ||
) | ||
); | ||
} else { | ||
|
@@ -325,7 +338,15 @@ protected void masterOperation( | |
new ElasticsearchException("Unable to update settings of rollup index [" + rollupIndexName + "]") | ||
); | ||
} | ||
}, e -> deleteRollupIndex(sourceIndexName, rollupIndexName, parentTask, listener, e))); | ||
}, | ||
e -> deleteRollupIndex( | ||
sourceIndexName, | ||
rollupIndexName, | ||
parentTask, | ||
listener, | ||
new ElasticsearchException("Unable to update settings of rollup index [" + rollupIndexName + "]", e) | ||
) | ||
)); | ||
} else { | ||
deleteRollupIndex( | ||
sourceIndexName, | ||
|
@@ -336,7 +357,6 @@ protected void masterOperation( | |
); | ||
} | ||
}, e -> deleteRollupIndex(sourceIndexName, rollupIndexName, parentTask, listener, e))); | ||
|
||
} else { | ||
listener.onFailure(new ElasticsearchException("Failed to create rollup index [" + rollupIndexName + "]")); | ||
} | ||
|
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.
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.
Maybe label it 6-8?
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.
Done in 393d7c2