OpenSearch: [BUG] new QueryGroupTask warning in 2.18
Describe the bug
The warning: https://github.com/opensearch-project/OpenSearch/pull/14708/files#diff-4e901163f39dfc072ae4d7f93a43f0958bdfdf2bb82f044b2ec9f3ae13fa66dfR56 Ideally should never happen, but it’s spamming our logs for our use cases.
Related component
Search
To Reproduce
curl -s -X POST "localhost:9200/some_index_name/_search?size=2&scroll=30s" -H "content-type: application/json" -d '{"query":{"match_all":{}}}'
with the _scroll_id from the response:
curl -s "localhost:9200/_search/scroll/${_scroll_id}?scroll=30s
The opensearch logs show:
2024-12-17T17:00:36.571341698Z [2024-12-17T17:00:36,570][WARN ][o.o.w.QueryGroupTask ] [b6feeca76aab] QueryGroup _id can't be null, It should be set before accessing it. This is abnormal behaviour
Expected behavior
No warning
Additional Details
Plugins Please list all plugins currently enabled.
Screenshots If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
- OS: [e.g. iOS]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 15 (11 by maintainers)
Thanks for bringing it to our attention I think in 2.x the scroll API changes were not merged in due to backward compatibility issues, We will address it as part of this PR: https://github.com/opensearch-project/OpenSearch/pull/17576
The issue is, the WLM picks all the
QueryGroupTasktypes and the Task is created inTransportActionclass but tagged in action specific transport classes, e,g;TransportSearchActionhence the querygroupId is missing in thoseQueryGroupTasks.Let me see what is causing this. Thanks rursprung bringing this to our attention.
FYI @kaushalmahi12. There’s a couple more cases here beyond scroll. @rursprung’s case suggests there might be a race condition during search triggering this case.
this problem also appears with simple requests against the
/searchAPI when you just send enough of them at the same time. tested using a stock 2.18.0 release (i disabled the security plugin for simplicity).i got the message 14x in the OS log during this time.
I’m also seeing this error popup on a fresh cluster running the re-index API.
@kaushalmahi12 Yes, as far as I can find, only the scroll APIs are affected.
@doug-numetric I suppose this is only happening for scroll APIs?
I think the mechanism to set the queryGroupId for scroll action is missing. To mitigate the logging from
QueryGroupTaskclass, we can do the following