Skip to content

Ensure we only serialize IndexModes when they are available#149409

Open
benwtrent wants to merge 4 commits into
elastic:patch/serverless-fixfrom
benwtrent:patch/serverless-fix-3106
Open

Ensure we only serialize IndexModes when they are available#149409
benwtrent wants to merge 4 commits into
elastic:patch/serverless-fixfrom
benwtrent:patch/serverless-fix-3106

Conversation

@benwtrent
Copy link
Copy Markdown
Member

We should only serialize stats for indexmodes that are available given the current feature flags.

@elasticsearchmachine elasticsearchmachine added serverless-linked Added by automation, don't add manually needs:triage Requires assignment of a team area label labels May 19, 2026
@benwtrent benwtrent added >bug :Search Relevance/Vectors Vector search v9.5.0 and removed needs:triage Requires assignment of a team area label labels May 19, 2026
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label May 19, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

JonasKunz and others added 3 commits May 19, 2026 11:46
This PR fixes potential NPEs that can arise from using an updates PIT id after relocation.
The issue is currently guarded by a feature flag an setting and was only observed during testing.

PIT id rewriting in AbstractSearchAsyncAction#maybeReEncodeNodeIds assumes that each
SearchPhaseResult used to update the id has a set ShardSearchContextId. However, there are
certain optimizations under which the data node might return a QuerySearchResult nullInstance()
which doesn't contain a ShardSearchContextId. Using these results to update the PIT id leads
to NPEs when using these ids in subsequent search requests.

The PR fixes this issue by not using the results ShardSearchContextId but the original PIT ids context.
Since only the target nodes change with PIT relocation and the context id remains fixed, this avoids
running into the NPE issues.

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

Labels

>bug :Search Relevance/Vectors Vector search serverless-linked Added by automation, don't add manually Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants