Skip to content

Fix interim async search paging in CCS - #160955

Closed
tsenart wants to merge 3 commits into
elastic:mainfrom
perfloop-oss:fix/async-search-interim-pagination
Closed

tsenart wants to merge 3 commits into
elastic:mainfrom
perfloop-oss:fix/async-search-interim-pagination

Conversation

@tsenart

@tsenart tsenart commented Oct 4, 2026 •

Copy link
Copy Markdown

Closes #160954.

This commit preserves requested paging in interim CCS async-search responses. The shared source is widened for outgoing searches, so each interim merger must use the original page and total-hit limit.

The two-cluster regression blocks the remote query, checks the exact interim hit IDs, then checks the completed page.

Native comparison, TransportSearchActionTests, full CrossClusterAsyncSearchIT, and checks for changed files passed on the original candidate. The rebase to d111ec80 preserves the patch. Full upstream CI is pending.

Found with Perfloop.

@cla-checker-service

cla-checker-service Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

💚 CLA has been signed

@elasticsearchmachine elasticsearchmachine added v9.6.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Oct 4, 2026
@tsenart
tsenart force-pushed the fix/async-search-interim-pagination branch from b7a268c to c4255f5 Compare October 4, 2026 05:28
@tsenart
tsenart marked this pull request as ready for review October 4, 2026 05:30
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Oct 4, 2026
@marianotepper marianotepper added :Search Foundations/Search Catch all for Search Foundations :Search Foundations/CCS and removed needs:triage Requires assignment of a team area label labels Oct 9, 2026
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Oct 9, 2026
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@reugn reugn self-assigned this Oct 12, 2026
@reugn
reugn self-requested a review October 12, 2026 16:26
@reugn reugn added >bug auto-backport Automatically create backport pull requests when merged branch:8.19 branch:9.4 branch:9.5 and removed :Search Foundations/CCS labels Oct 12, 2026

@reugn reugn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, @tsenart.

Two small things before we merge:

  • Please add a changelog entry since this is a bug fix, docs/changelog/160955.yaml, in the same format as the other entries in docs/changelog/.

  • Could you add a unit test in TransportSearchActionTests? None of the ccsRemoteReduce tests set from/size, which is why this wasn't caught there. Something like the following would work, with the local cluster plus at least one remote.

    searchRequest.source(new SearchSourceBuilder().from(3).size(2));
    // ... ccsRemoteReduce(task, ...)
    try (SearchResponseMerger merger = task.getSearchResponseMergerSupplier().get()) {
        assertEquals(3, merger.from);
        assertEquals(2, merger.size);
    }

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-infra (Team:Search Foundations)

@tsenart

tsenart commented Oct 25, 2026

Copy link
Copy Markdown
Author

#163290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug external-contributor Pull request authored by a developer outside the Elasticsearch team :Search Foundations/CCS :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v8.19.25 v9.4.10 v9.5.7 v9.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async CCS interim results ignore requested paging

4 participants