Fix the force merge with Quantization failures when a segment has deleted docs in it#2046
Merged
navneet1v merged 1 commit intoopensearch-project:mainfrom Sep 5, 2024
Merged
Conversation
Collaborator
Author
|
Checking why CIs are failing |
Collaborator
Author
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 <[email protected]>
naveentatikonda
approved these changes
Sep 5, 2024
Collaborator
|
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
Collaborator
Author
|
waiting on CIs to complete. |
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Sep 5, 2024
…eted docs in it (#2046) Signed-off-by: Navneet Verma <[email protected]> (cherry picked from commit da854c9)
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Sep 5, 2024
…eted docs in it (#2046) Signed-off-by: Navneet Verma <[email protected]> (cherry picked from commit da854c9)
navneet1v
added a commit
that referenced
this pull request
Sep 5, 2024
…eted docs in it (#2046) (#2051) Signed-off-by: Navneet Verma <[email protected]> (cherry picked from commit da854c9) Co-authored-by: Navneet Verma <[email protected]>
navneet1v
added a commit
that referenced
this pull request
Sep 5, 2024
…eted docs in it (#2046) (#2052) Signed-off-by: Navneet Verma <[email protected]> (cherry picked from commit da854c9) Co-authored-by: Navneet Verma <[email protected]>
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 <[email protected]> Signed-off-by: Akash Shankaran <[email protected]>
jingqimao77-spec
pushed a commit
to jingqimao77-spec/k-NN
that referenced
this pull request
Mar 15, 2026
…eted docs in it (opensearch-project#2046) Signed-off-by: Navneet Verma <[email protected]>
This file contains hidden or 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
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 thecostwhich 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.