Fix queries with missing index, skip_unavailable and filters#130344
Merged
smalyshev merged 2 commits intoelastic:mainfrom Jun 30, 2025
Merged
Fix queries with missing index, skip_unavailable and filters#130344smalyshev merged 2 commits intoelastic:mainfrom
smalyshev merged 2 commits intoelastic:mainfrom
Conversation
Collaborator
|
Hi @smalyshev, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Collaborator
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the handling of filtered queries when remote indices are missing and skip_unavailable is true by adjusting error propagation and cluster state marking. Key changes include:
- Updating the error condition in EsqlCCSUtils.java to account for a non-null filter.
- Modifying test scenarios in CrossClusterQueryWithFiltersIT.java to reflect remote index changes and new error messages.
- Updating the changelog documentation to summarize the bug fix.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlCCSUtils.java | Adjusted the condition to include a filter flag for error handling. |
| x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterQueryWithFiltersIT.java | Updated test scenarios to check for remote index failures and error messages. |
| docs/changelog/130344.yaml | Added changelog entry for the bug fix. |
Comments suppressed due to low confidence (1)
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlCCSUtils.java:224
- Consider enhancing the inline comment to clarify why a non-null filter leads to bypassing the final state marking, ensuring the intended behavior is clearly understood by future maintainers.
if (executionInfo.isSkipUnavailable(c) == false || filter != null) {
...rnalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterQueryWithFiltersIT.java
Show resolved
Hide resolved
smalyshev
added a commit
to smalyshev/elasticsearch
that referenced
this pull request
Jun 30, 2025
…#130344) * Fix queries with missing index, skip_unavailable and filters
smalyshev
added a commit
to smalyshev/elasticsearch
that referenced
this pull request
Jun 30, 2025
…#130344) * Fix queries with missing index, skip_unavailable and filters
Collaborator
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jul 1, 2025
#130370) * Fix queries with missing index, skip_unavailable and filters
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jul 1, 2025
#130369) * Fix queries with missing index, skip_unavailable and filters
mridula-s109
pushed a commit
to mridula-s109/elasticsearch
that referenced
this pull request
Jul 3, 2025
…#130344) * Fix queries with missing index, skip_unavailable and filters
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.
Fix filtered query not being handled correctly when remote indices are missing and skip_unavailable=true. In this case, we need to produce exception on the first pass and have the second pass sort it out - whether it's legit index being filtered, or missing index.