Skip to content

ESQL: ValueSourceReader sometimes tries to append empty blocks #128959

Closed
@alex-spies

Description

@alex-spies
Contributor

Got this stack trace from Serverless from a simple query:

  java.lang.IllegalArgumentException: Block [BytesRefVectorBlock[vector=BytesRefArrayVector[positions=0]]] does not have same position count: 0 != 10    
   at org.elasticsearch.compute.data.Page.<init>(Page.java:88)                                                                                                                       
   at org.elasticsearch.compute.data.Page.appendBlocks(Page.java:174)                                                                                                                
   at org.elasticsearch.compute.lucene.ValuesSourceReaderOperator.process(ValuesSourceReaderOperator.java:174)                                                                       
   at org.elasticsearch.compute.operator.AbstractPageMappingOperator.getOutput(AbstractPageMappingOperator.java:85)                                                                  
   at org.elasticsearch.compute.operator.Driver.runSingleLoopIteration(Driver.java:265)                                                                                              
   at org.elasticsearch.compute.operator.Driver.run(Driver.java:185)                                                                
   at org.elasticsearch.compute.operator.Driver$1.doRun(Driver.java:406)                                                            
   at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)                                       
   at org.elasticsearch.compute.operator.DriverScheduler$1.doRun(DriverScheduler.java:57)                                           
   at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)                                       
   at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:35)                                           
   at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:1044)       
   at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)                                       
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1095)                                               
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:619)                                               
   at java.lang.Thread.run(Thread.java:1447)

This indicates that the ValueSourceReaderOperator tries to append blocks with 0 positions, even though we should fetch field values for 10 positions.

The query that triggered this was simple and in essence

FROM idx | WHERE field == "value"

together with a specific time range picked via the filter request field. idx is actually a data stream, which may be relevant. Happened for some time ranges, but not for others - maybe due to rollover at some point in time and thus picking up different shards.

In the specific case, field was a constant keyword field; but we also saw problems with just

FROM idx

with a specific time range in the filter request field.

Activity

elasticsearchmachine

elasticsearchmachine commented on Jun 5, 2025

@elasticsearchmachine
Collaborator

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

alex-spies

alex-spies commented on Jun 5, 2025

@alex-spies
ContributorAuthor

Going by recent changes to the value source reader operator, this PR might be relevant to the bug: #127348

added a commit that references this issue on Jun 6, 2025
923f029
added a commit that references this issue on Jun 6, 2025
01cd102
added a commit that references this issue on Jun 6, 2025
b65e37a

15 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @elasticsearchmachine@alex-spies

      Issue actions

        ESQL: ValueSourceReader sometimes tries to append empty blocks · Issue #128959 · elastic/elasticsearch