Skip to content

[8.17] Aggs: Add cancellation checks to FilterByFilter aggregator (#130452) #130743

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

Conversation

ivancea
Copy link
Contributor

@ivancea ivancea commented Jul 7, 2025

Manual 8.17 backport of #130452

…30452)

By default, the `FilterByFilterAggregator` (Used by the `"filter"` and `"filters"` aggs) was using the `DefaultBulkScorer` (From Lucene), which has no cancellation mechanism.

This PR wraps it into a `CancellableBulkScorer`, which instead calls the inner scorer with ranges, and checks cancellation between them.

This should solve cases of long-running tasks using these aggregators not being cancelled, or greatly reduce the time they take after cancellation.
@ivancea ivancea added >bug backport Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL v8.17.9 labels Jul 7, 2025
@ivancea ivancea changed the title Aggs: Add cancellation checks to FilterByFilter aggregator (#130452) [8.17] Aggs: Add cancellation checks to FilterByFilter aggregator (#130452) Jul 7, 2025
@ivancea ivancea added :Analytics/Aggregations Aggregations auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) and removed :Analytics/ES|QL AKA ESQL labels Jul 7, 2025
@elasticsearchmachine elasticsearchmachine merged commit 2b49fde into elastic:8.17 Jul 7, 2025
16 checks passed
@ivancea ivancea deleted the backport-8.17-aggs-filters-cancellation branch July 7, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.17.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants