Skip to content

Conversation

@lkts
Copy link
Contributor

@lkts lkts commented Nov 7, 2025

SplitShardCountSummary is a piece of metadata specific to resharding feature. It is needed to ensure correctness of search results during resharding.

This PR propagates SplitShardCountSummary calculated by a coordinator when obtaining routing information to data nodes. Since ESQL accesses routing information via a separate API this requires changing the search shards API response. It is then plugged into a ShardSearchRequest that is passed to createSearchContext call (see also #135804). In future a custom searcher that ensures that correct documents are returned during resharding will be created using this value. This PR does not include this logic and only ensures that a correct ShardSearchRequest is created.

return waitForCheckpoint;
}

// Used by ValidateQueryAction, ExplainAction, FieldCaps, TermsEnumAction, lookup join in ESQL
Copy link
Contributor Author

@lkts lkts Nov 10, 2025

Choose a reason for hiding this comment

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

As noted, additional handling may be needed for lookup join.

Copy link
Member

Choose a reason for hiding this comment

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

Currently, resizing lookup indices is not allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RIght, thanks. I think i would like to still pass the summary if it's available in that context just to avoid inconsistency. It would be a follow up anyway.

@lkts lkts marked this pull request as ready for review November 10, 2025 19:01
@lkts lkts requested review from bcully and dnhatn November 10, 2025 19:01
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Nov 10, 2025
@lkts lkts added >non-issue :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. :Analytics/ES|QL AKA ESQL and removed needs:triage Requires assignment of a team area label labels Nov 10, 2025
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Distributed Indexing Meta label for Distributed Indexing team labels Nov 10, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

// This value is specific to resharding feature and this code path is specific to CCS
// involving 8.x remote cluster.
// We don't currently expect resharding to be used in such conditions so it's unset.
this.reshardSplitShardCountSummary = SplitShardCountSummary.UNSET;
Copy link
Member

Choose a reason for hiding this comment

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

I can open a PR to remove this BWC after your PR, as it is no longer needed in 9.x.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh nice, we don't allow CCS between majors?

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Sasha!

@lkts lkts enabled auto-merge (squash) November 12, 2025 18:29
@lkts lkts merged commit f66095b into elastic:main Nov 12, 2025
34 checks passed
@lkts lkts deleted the resharding_esql branch November 12, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Distributed Indexing Meta label for Distributed Indexing team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants