-
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] OpenSearch non-deterministically returning fewer than size
hits when search_after
is configured even if hits exist
#9537
Comments
@gashutos care to take a quick look? |
@dblock looking. |
@calebmer I've ran the script provided by you 5/6 times and was not able to reproduce this bug on 2.9.0 |
@gashutos Hmm. It’s still reproing for me, confirmed I’m running 2.9.0. Let me give more system details… I installed OpenSearch fresh, no extra configuration, with Homebrew on my macOS 12.3 computer running an Apple M1 chip. The commands I ran were effectively:
…and it reproduced on the first run. Confirmed from |
I borrowed a friend’s laptop which does not have OpenSearch installed and was able to reproduce using the same steps. So it’s not some configuration unique to my setup. They also are running macOS on an Apple M1 chip. |
@calebmer yes, I am able to repro the bug now, it is coming with Lucene 9.7.0 upgrade. Will be sending fix soon. |
Not sure about exact root cause yet, but reverting this PR apache/lucene#12334 of lucene works fine. |
PR raised here with fix. This scenario is specifically happening when search after is delaling with |
@gashutos very nice job! |
This should be fix after lucene 9.8 upgrade. |
Closing this issue, since the bug was fixed in Lucene. We should expect the fix to be available in OpenSearch 2.11. |
Thanks @msfroh |
Describe the bug
In one of my tests, I think a bug in OpenSearch is causing it to be flaky.
I have five items:
I sort them by
[priority, createdTime]
. I issue a search withsize
of1
andsearch_after
for the third item ([2147483647, 3]
). I’d expect to get a response containing just{createdTime: 4, priority: null}
which OpenSearch does give me most of the time. However, occasionally it returns zero items.To Reproduce
Here’s a minimal reproduction script for the issue on OpenSearch 2.9.0:
An example output for me:
This script runs the test scenario 100 times and exits on failure. As you can see most of the time I get the correct result (
Hits: 1
) but fairly frequently you get an incorrect result (Hits: 0
).Expected behavior
I’d expect OpenSearch to always return a hit that matches the search if one exists.
A little more color on my use case: I perform these queries as a part of pagination. My system will sometimes do a
size
of 1 search to check if there is more data on the next page. If it gets back zero results I consider pagination to be over. So it’s kinda bad if I don’t show the user all results because OpenSearch failed to return a hit.Plugins
I remove all plugins on installation (
rm -rf plugins
).Host/Environment (please complete the following information):
Additional context
Since I’m running OpenSearch locally I’ve configured
discovery.type: single-node
.The text was updated successfully, but these errors were encountered: