Skip to content

Conversation

piergm
Copy link
Member

@piergm piergm commented Jul 24, 2025

Backports the following commits to 9.0:

…stic#130279) When a search targets a single shard, the fetch phase is executed in the same roundtrip as the query phase. In that case the search context is reused across phases, and the cancellation runnables registered to the searcher are reused. This is incorrect as the search timeout check should not be applied to the fetch phase, or it will make fetching partial results unfeasible. For instance if the query phase times out, the fetch phase will time out as well and there won't be partial results. If the query phase does not time out, but the fetch phase does, the latter will return a different set of results compared to those expected which will lead to unexpected situations like an array index out of bound exception. This commit clears the cancellation runnables ahead of running the fetch phase in the same rountrip as query and performs their registration once again, without the timeout checks which are never applied to the fetch phase. Closes elastic#130071
@piergm piergm added :Search Foundations/Search Catch all for Search Foundations >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch labels Jul 24, 2025
@piergm
Copy link
Member Author

piergm commented Jul 24, 2025

@elasticsearchmachine elasticsearchmachine merged commit 48cf0b1 into elastic:9.0 Jul 25, 2025
19 checks passed
@piergm piergm deleted the backport/9.0/pr-130279 branch July 25, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug external-contributor Pull request authored by a developer outside the Elasticsearch team :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.0.5

3 participants