Skip to content

Conversation

idegtiarenko
Copy link
Contributor

@idegtiarenko idegtiarenko commented Aug 28, 2025

Running a row query with any filter fails with the following assertion error:

[2025-08-28T11:07:27,149][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [runTask-0] fatal error in thread [elasticsearch[runTask-0][search][T#1]], exiting java.lang.AssertionError: ClusterMap in EsqlExecutionInfo must not be empty
	at org.elasticsearch.xpack.esql.action.EsqlExecutionInfo.getClusterStates(EsqlExecutionInfo.java:314)
	at org.elasticsearch.xpack.esql.session.EsqlCCSUtils.updateExecutionInfoWithClustersWithNoMatchingIndices(EsqlCCSUtils.java:207)
	at org.elasticsearch.xpack.esql.session.EsqlSession.analyzeWithRetry(EsqlSession.java:697)
	at org.elasticsearch.xpack.esql.session.EsqlSession.lambda$analyzedPlan$11(EsqlSession.java:389)

Filter is not really applicable for the row query, but regardless it should not tip assertion.
This change fixes that.

elasticsearchmachine and others added 2 commits August 28, 2025 10:27
@idegtiarenko idegtiarenko changed the title TBD Fix assertion error when executing row query with filter Aug 28, 2025
@idegtiarenko idegtiarenko added >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL v9.1.0 labels Aug 28, 2025
@idegtiarenko idegtiarenko marked this pull request as ready for review August 28, 2025 11:56
@elasticsearchmachine
Copy link
Collaborator

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

// We won't run this check with no filter and no valid indices since this may lead to false positive - missing index report
// when the resolution result is not valid for a different reason.
EsqlCCSUtils.updateExecutionInfoWithClustersWithNoMatchingIndices(executionInfo, result.indices, requestFilter != null);
if (executionInfo.clusterInfo.isEmpty() == false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also be if(executionInfo.isCrossClusterSearch()) because there's really no point of doing this if it's not cross-cluster - the only way it could do anything is if the local indices are all filtered and this case is already handled by the verifier. Which would implicitly include your case also.

@idegtiarenko idegtiarenko merged commit 12fd34d into elastic:main Aug 29, 2025
33 checks passed
@idegtiarenko idegtiarenko deleted the fix_row_assertion_error branch August 29, 2025 08:25
@idegtiarenko idegtiarenko added the auto-backport Automatically create backport pull requests when merged label Aug 29, 2025
idegtiarenko added a commit to idegtiarenko/elasticsearch that referenced this pull request Aug 29, 2025
idegtiarenko added a commit to idegtiarenko/elasticsearch that referenced this pull request Aug 29, 2025
elasticsearchmachine pushed a commit that referenced this pull request Aug 29, 2025
elasticsearchmachine pushed a commit that referenced this pull request Aug 29, 2025
) (#133792)

* Fix assertion error when executing row query with filter (#133704)

(cherry picked from commit 12fd34d)

* fix compilation
JeremyDahlgren pushed a commit to JeremyDahlgren/elasticsearch that referenced this pull request Aug 29, 2025
sarog pushed a commit to portsbuild/elasticsearch that referenced this pull request Sep 11, 2025
…tic#133704) (elastic#133792)

* Fix assertion error when executing row query with filter (elastic#133704)

(cherry picked from commit 12fd34d)

* fix compilation
sarog pushed a commit to portsbuild/elasticsearch that referenced this pull request Sep 19, 2025
…tic#133704) (elastic#133792)

* Fix assertion error when executing row query with filter (elastic#133704)

(cherry picked from commit 12fd34d)

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

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.19.4 v9.1.4 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants