-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] NPE when queryResults.isEmpty() but hasAggs is true #5785
Comments
Added example to reproduce problem. |
@janheise You did most of the work to debug this! Thank you. Want to try to implement a unit test and maybe even a fix? |
@dblock I am currently too busy to tackle it myself - and am surprised about the |
@janheise Thanks! @anasalkouz triaged it as such, I imagine because there's a request/response repro (thank you). I think a unit test is not too difficult based on this, but I agree that fixing the problem may be much more involved. Would value a PR that just has the unit test, it will get whomever wants to fix this one step further. |
/assign |
When I tried to debug, it turned out that queryResults has size of 1 and hence it doesn't go into below condition OpenSearch/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java Lines 465 to 467 in af566e1
Instead below aggregation variable evaluates to null, because bufferedAggs list is empty. OpenSearch/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java Line 536 in af566e1
|
Agreed, will keep the label for the unit test |
Hey @anasalkouz @janheise @dblock, I am going to pick this up since the previous assignee has left. Will reply here if I need any help |
Hi @geetptl, it has been a while, are you actively working on this? |
There may be a repro in #7089. Help us turn this into a failing unit test? |
Could you give a rough estimate about when the issue could be solved or if someone actively works on it? We have some business decisions depending on that. |
@z002Holpp I would say nobody is working on it unless it clearly says so, and looks like @geetptl isn't around to confirm they still are :( maybe you can help with some hands? |
Het @dblock, I'm not working on this, feel free to take it up! |
Describe the bug
We have the following occuring;
If there is an empty result:
OpenSearch/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java
Lines 465 to 467 in 8c9481a
returns with an almost empty
ReducedQueryPhase
instance, which further on inOpenSearch/server/src/main/java/org/opensearch/action/search/QueryPhaseResultConsumer.java
Lines 163 to 165 in 8c9481a
creates an NPE if the query had aggregations.
It is probably related to the
multi_terms
aggregation.To Reproduce
Steps to reproduce the behavior:
PUT http://localhost:9200/test_jh
The following error occurs:
Expected behavior
There should be no NPE, the empty result should be propagated as is.
Host/Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: