Repository navigation
Fix interim async search paging in CCS - #163290
Merged
reugn merged 3 commits intoNov 11, 2026
Merged
Conversation
|
💚 CLA has been signed |
|
Hi, I'm Tomás, I build Perfloop. I approved this contribution and will handle review feedback here. We've had performance PRs merged in ClickHouse, Prometheus, Ruff/ty, parquet-go, RoaringBitmap, and more. |
tsenart
force-pushed
the
fix/async-search-interim-pagination-agent
branch
from
November 4, 2026 12:23
6f83eb5 to
21c2728
Compare
Collaborator
|
Pinging @elastic/es-search-infra (Team:Search Foundations) |
|
@reugn: Thanks again for your review on #160955. This PR replaces it and covers both of your points: it adds |
Member
|
buildkite test this |
This was referenced Nov 11, 2026
elasticsearchmachine
pushed a commit
that referenced
this pull request
Nov 11, 2026
An async cross-cluster search with ccs_minimize_roundtrips=true returned extra hits in interim responses when from was greater than 0. Before it sends the per-cluster searches, the coordinator rewrites the shared search source to from: 0 and size: from + size. The supplier that builds the interim merger read the page from that rewritten source, so interim responses returned the whole widened window instead of the requested page. The final response was always correct. The supplier now takes from, size and track_total_hits from the first merger, which keeps the requested values. (cherry picked from commit e93c8ff) Co-authored-by: Perfloop Agent <[email protected]>
elasticsearchmachine
pushed a commit
that referenced
this pull request
Nov 11, 2026
An async cross-cluster search with ccs_minimize_roundtrips=true returned extra hits in interim responses when from was greater than 0. Before it sends the per-cluster searches, the coordinator rewrites the shared search source to from: 0 and size: from + size. The supplier that builds the interim merger read the page from that rewritten source, so interim responses returned the whole widened window instead of the requested page. The final response was always correct. The supplier now takes from, size and track_total_hits from the first merger, which keeps the requested values. (cherry picked from commit e93c8ff) Co-authored-by: Perfloop Agent <[email protected]>
elasticsearchmachine
pushed a commit
that referenced
this pull request
Nov 11, 2026
An async cross-cluster search with ccs_minimize_roundtrips=true returned extra hits in interim responses when from was greater than 0. Before it sends the per-cluster searches, the coordinator rewrites the shared search source to from: 0 and size: from + size. The supplier that builds the interim merger read the page from that rewritten source, so interim responses returned the whole widened window instead of the requested page. The final response was always correct. The supplier now takes from, size and track_total_hits from the first merger, which keeps the requested values. (cherry picked from commit e93c8ff) Co-authored-by: Perfloop Agent <[email protected]>
sarog
pushed a commit
to portsbuild/elasticsearch
that referenced
this pull request
Nov 24, 2026
An async cross-cluster search with ccs_minimize_roundtrips=true returned extra hits in interim responses when from was greater than 0. Before it sends the per-cluster searches, the coordinator rewrites the shared search source to from: 0 and size: from + size. The supplier that builds the interim merger read the page from that rewritten source, so interim responses returned the whole widened window instead of the requested page. The final response was always correct. The supplier now takes from, size and track_total_hits from the first merger, which keeps the requested values. (cherry picked from commit e93c8ff) Co-authored-by: Perfloop Agent <[email protected]>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #160954.
What goes wrong. An async cross-cluster search with
ccs_minimize_roundtrips=truereturns the wrong page while a remote cluster is still running. Withfrom: 3andsize: 2, the interim response holds five local hits (local-0tolocal-4) instead oflocal-3andlocal-4. The final response is correct.Cause. Before it sends the per-cluster searches,
TransportSearchActionrewrites the shared search source tofrom: 0, size: from + size. The supplier that builds the merger for interim responses then reads the page from that rewritten source.Change. The supplier now takes
from,sizeandtrack_total_hitsfrom the coordinating merger, which keeps the requested values. As onmain, interim mergers get no circuit breaker.Test.
CrossClusterAsyncSearchIT.testCcsMinimizeRoundtripsIntermediateResultsUseRequestedPageblocks the remote query, checks the interim hit IDs, and then checks the final page. It fails onmainwithout this change and passes with it.TransportSearchActionTests.testCCSRemoteReducenow also checks the interim merger's page and total-hits limit, with and without a local cluster.Found with Perfloop.