-
Notifications
You must be signed in to change notification settings - Fork 140
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
Fix the force merge with Quantization failures when a segment has deleted docs in it #2046
Merged
Conversation
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
Checking why CIs are failing |
CIs were failing because the code was skipping some docs during live docs counting. Now the logic is fixed. Thanks @jmazanec15 for help in debugging. |
…eted docs in it Signed-off-by: Navneet Verma <navneev@amazon.com>
naveentatikonda
approved these changes
Sep 5, 2024
LGTM |
ryanbogan
approved these changes
Sep 5, 2024
Vikasht34
approved these changes
Sep 5, 2024
shatejas
reviewed
Sep 5, 2024
...in/java/org/opensearch/knn/index/codec/nativeindex/MemOptimizedNativeIndexBuildStrategy.java
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsWriter.java
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/KNN990Codec/NativeEngines990KnnVectorsWriter.java
Show resolved
Hide resolved
jmazanec15
approved these changes
Sep 5, 2024
shatejas
approved these changes
Sep 5, 2024
waiting on CIs to complete. |
Merged
3 tasks
akashsha1
pushed a commit
to akashsha1/k-NN
that referenced
this pull request
Sep 16, 2024
…eted docs in it (opensearch-project#2046) Signed-off-by: Navneet Verma <navneev@amazon.com> Signed-off-by: Akash Shankaran <akash.shankaran@intel.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fix the force merge with Quantization failures when a segment has deleted docs in it.
Issue:
When documents are deleted from the segment and segments are force merged, the FlatVectorValues are getting merged to 1 vectorValues but that
vectorvalue.getLiveDocs()
doesn't provide correct live docs but it provides thecost
which includes the deleted docs too.Due to this when we are doing quantization, we are hitting the vectors which are not present and leading to NPE.
With this change, we are ensuring that we are iterating over the vector values to find the correct live docs and then pass it to Quantization and NativeIndexWriter.
Testing
I added an IT that simulate this buggy nature, but due to some race conditions it doesn't work 100% of the time. I will follow up on fixing the IT and make it more strict.
Manual Testing
Currently I tested manually by below flow, which always create exceptions without this fix.
Index Data
Index data again to simulate deletes
Do force merge
check logs to see the errors.
** Do Search it fails without this fix**
Issue
#1949
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.