Skip to content

Conversation

ivancea
Copy link
Contributor

@ivancea ivancea commented Jul 7, 2025

Manual 9.0 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 v9.0.4 labels Jul 7, 2025
@ivancea ivancea changed the title Aggs: Add cancellation checks to FilterByFilter aggregator (#130452) [9.0] 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 15e9ff3 into elastic:9.0 Jul 7, 2025
17 checks passed
@ivancea ivancea deleted the backport-9.0-aggs-filters-cancellation branch July 7, 2025 17:18
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) v9.0.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants