Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESQL: can't increase refCount on already released object [ConstantNullBlock[...]] #125850

Open
alex-spies opened this issue Mar 28, 2025 · 1 comment
Assignees
Labels
:Analytics/Compute Engine Analytics in ES|QL :Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@alex-spies
Copy link
Contributor

Elasticsearch Version

main, 8.16.3

Installed Plugins

No response

Java Version

N/A

OS Version

N/A

Problem Description

Queries with union types of type boolean/keyword can lead to re-using an already released constant null block in the value source reader operator. This causes an illegal state exception and returns a 500 to the user.

The error may be in ComputeBlockLoaderFactory.constantNulls() (here), where we do not take into account that a constant null block that was once handed out may already have been consumed and closed downstream.

Steps to Reproduce

./gradlew run

curl -u elastic-admin:elastic-password -H "Content-Type: application/json" "127.0.0.1:9200/test1" -XPUT -d '{
  "mappings": {
        "properties": {"truefalse1": {"type": "boolean"}, "truefalse2": {"type": "boolean"}}}}'

curl -u elastic-admin:elastic-password -H "Content-Type: application/json" "127.0.0.1:9200/test2" -XPUT -d '{
  "mappings": {
        "properties": {"truefalse1": {"type": "keyword"}, "truefalse2": {"type": "keyword"}}}}'

curl -u elastic-admin:elastic-password -H "Content-Type: application/json" "127.0.0.1:9200/test3" -XPUT -d '{
  "mappings": {
        "properties": {"truefalse1": {"type": "keyword"}, "truefalse2": {"type": "keyword"}}}}'

curl -u elastic:password -HContent-Type:application/json 'localhost:9200/test1/_doc?refresh' -d '{"truefalse1": null}'

curl -u elastic:password -HContent-Type:application/json 'localhost:9200/test2/_doc?refresh' -d '{"truefalse1": null}' 

curl -u elastic:password -HContent-Type:application/json 'localhost:9200/test3/_doc?refresh' -d '{"foo": 1}'

curl -u elastic-admin:elastic-password -H "Content-Type: application/json" 'localhost:9200/_query?format=txt&error_trace' -d '
{
  "query": "from test* | eval t1 = truefalse1::boolean, t2 = truefalse2::boolean | keep t1, t2"
}'

Logs (if relevant)

No response

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Mar 28, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@alex-spies alex-spies self-assigned this Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Compute Engine Analytics in ES|QL :Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

2 participants