-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
Searcher
and its SearcherGeneration
may reference a different set of segments
#1461
Comments
fixes #1461 fixes a race condition in Searcher, by avoiding repeated calls to open_segment_readers and passing them instead as argument
@shikhar Thanks for the report, I think your analysis is correct. I created a PR, which is a little more minimal than yours, by passing the segment_readers as argument instead of reloading. Did you experience a crash and if yes can you post the error message so it's more discoverable if someone else has the same problem? |
fixes #1461 fixes a race condition in Searcher, by avoiding repeated calls to open_segment_readers and passing them instead as argument
@PSeitz this was from a panic in our custom
|
Fixes a race condition in Searcher, by avoiding repeated calls to open_segment_readers and passing them instead as argument Closes #1461
Bug
With tantivy @ d24f31f,
ran into a situation where Gen 1 below of the Searcher has an inconsistent set of segment IDs referenced in its
SearcherGeneration
object.Gen 0: good
Gen 1: bad
Reason
Looks like this may have been a regression introduced in 23fe73a cc @PSeitz
In between the below calls to
open_segment_readers()
is potential for a race condition.tantivy/src/reader/mod.rs
Line 239 in 23fe73a
tantivy/src/reader/mod.rs
Line 224 in 23fe73a
The solution seems to be to only call it once when creating a
Searcher
, this used to be the case before. And maybe we can add an assertion that the set ofSegmentId
s is identical.The text was updated successfully, but these errors were encountered: