-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multithreading copies in lib vec (#108802)
This commit fixes a potential multithreading issue with the lib vec vector scorer. Since the implementation falls back to a lucene scorer which needs to read from the index input, then we need to make a copy of the index input. Otherwise, there is a potential for the stateful index input to be accessed across threads - which would be bad. The fallback is only used when one or other vector cross a segment boundary, which is 16G by default. So the likelihood of this occurring in practice is small, but the affect is bad. The fix is deliberately small and targeted, so that it can be backported. After this change, I'm going to drop the custom VectorScorer and adapter type, in favour of using the Lucene type directly. This custom types were initially used when the code lived inside the native module, where we didn't want to add a dependency on Lucene directly.
- Loading branch information
1 parent
c59322e
commit a7e4423
Showing
7 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 108802 | ||
summary: Fix multithreading copies in lib vec | ||
area: Vector Search | ||
type: bug | ||
issues: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters