Stop using round-tripped PipelineAggregators (backport of #53423) #53629
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.
This begins to clean up how
PipelineAggregators and executed.Previously, we would create the
PipelineAggregators on the data nodesand embed them in the aggregation tree. When it came time to execute the
pipeline aggregation we'd use the
PipelineAggregators that were on thefirst shard's results. This is inefficient because:
PipelineAggregatoronly toserialize it and then throw it away.
PipelineAggregators even though it only needs one of them.PipelineAggregatorinstances when you onlyreally need one per pipeline.
PipelineAggregatorneeds to implement serialization.This begins to undo these by building the
PipelineAggregators directlyon the coordinating node and using those instead of the
PipelineAggregators in the aggregtion tree. In a follow up changewe'll stop serializing the
PipelineAggregators to node versions thatsupport this behavior. And, one day, we'll be able to remove
PipelineAggregatorfrom the aggregation result tree entirely.Importantly, this doesn't change how pipeline aggregations are declared
or parsed or requested. They are still part of the
AggregationBuildertree because that makes sense.