-
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
Release aggregations earlier during reduce #124520
Release aggregations earlier during reduce #124520
Conversation
Pinging @elastic/es-analytical-engine (Team:Analytics) |
} | ||
}; | ||
return topLevelReduce(aggregations, context); | ||
public static InternalAggregations topLevelReduce(Iterator<InternalAggregations> aggs, int count, AggregationReduceContext context) { |
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 method is single-use for now but I left it here since it could be used where the existing version of it that consumes a list is used today as well to save some more indirection and maybe heap.
server/src/main/java/org/elasticsearch/action/search/QueryPhaseResultConsumer.java
Show resolved
Hide resolved
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 makes sense to me.
Although the failure in CI might need attention |
Funny enough, I think that failure was unrelated. I'll comment on the already existing issue for it. Thanks Ignacio! |
💔 Backport failed
You can use sqren/backport to manually backport by running |
Release each hit's aggregations before moving on to the next hit and unlink it from the shard result even earlier. Also, do the aggregation-reduce earlier in the reduce steps to reduce average heap use over time. To that effect, do not do the reduction in the search phase controller. This has the added benefit of removing any need for a fake aggs-reduce-context in scroll.
Release each hit's aggregations before moving on to the next hit and unlink it from the shard result even earlier.
Also, do the aggregation-reduce earlier in the reduce steps to reduce average heap use over time.
To that effect, do not do the reduction in the search phase controller. This has the added benefit of removing any need for a fake aggs-reduce-context in scroll.