-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Do not share Weight between Drivers #133446
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
Conversation
Hi @dnhatn, I've created a changelog YAML for you. |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small question.
} | ||
} | ||
|
||
private static class OwningWeight extends FilterWeight { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we put the Query
into LuceneScorer
instead of into the Weight
? There's already a bunch of useful stuff. We could do:
+ private final Query query;
private final Weight weight;
and check there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I've updated the LuceneScorer to keep both the query and tags.
Makes sense to me. |
Thanks Nik! |
We have encountered the following error in serverless: ``` java.lang.NullPointerException: Cannot invoke \"org.apache.lucene.search.BulkScorer.score(org.apache.lucene.search.LeafCollector, org.apache.lucene.util.Bits, int, int)\" because \"this.bulkScorer\" is null at org.elasticsearch.compute.lucene.LuceneOperator$LuceneScorer.scoreNextRange(LuceneOperator.java:233) at org.elasticsearch.compute.lucene.LuceneSourceOperator.getCheckedOutput(LuceneSourceOperator.java:307) at org.elasticsearch.compute.lucene.LuceneOperator.getOutput(LuceneOperator.java:143) at org.elasticsearch.compute.operator.Driver.runSingleLoopIteration(Driver.java:272) at org.elasticsearch.compute.operator.Driver.run(Driver.java:186) at org.elasticsearch.compute.operator.Driver$1.doRun(Driver.java:420) ``` I spent considerable time trying to reproduce this issue but was unsuccessful, although I understand how it could occur. Weight should not be shared between threads. Most Weight implementations are safe to share, but those for term queries (e.g., TermQuery, multi-term queries) are not, as they contain mutable This change proposes to stop sharing Weight between Drivers.
This reverts commit 2f10065. # Conflicts: # x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/lucene/TimeSeriesSourceOperator.java
We have encountered the following error in serverless:
I spent considerable time trying to reproduce this issue but was unsuccessful, although I understand how it could occur. Weight should not be shared between threads. Most Weight implementations are safe to share, but those for term queries (e.g., TermQuery, multi-term queries) are not, as they contain mutable TermStates.
This change proposes to stop sharing Weight between Drivers.
I am not sure if we should backport this to 8.19 and 9.1, since without the SliceQueue improvement from #132774, this fix may slow down queries due to the increased cost of creating more Weight instances.