-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add short circuit if no live docs are in segments #2059
Conversation
90d1f44
to
f06dc38
Compare
// Count the docIds | ||
int totalLiveDocs = getLiveDocs(vectorValuesRetriever.apply(vectorDataType, fieldInfo, VectorProcessingContext)); | ||
if (quantizationParams != null && totalLiveDocs > 0) { | ||
if (totalLiveDocs == 0) { | ||
log.debug("No live docs for field " + fieldInfo.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm - this wont lead to an issue on search if an empty file is expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmazanec15 Can you give more context when do we expect empty file? I see this is already added inside index method
k-NN/src/main/java/org/opensearch/knn/index/codec/nativeindex/NativeIndexWriter.java
Line 134 in 7bf52ac
private void buildAndWriteIndex(final KNNVectorValues<?> knnVectorValues, int totalLiveDocs) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For search and warmup, we should make sure that we arent reading this file if the size is empy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline and confirmed that if file is empty, we are not reading the file since we check whether file exists or not before reading it.
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
f06dc38
to
0bf2e77
Compare
CI failure is not related to this PR. It is failing since we are in the midst of release. |
* Add short circuit if no live docs are in segments Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> --------- Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> (cherry picked from commit 7aedefd)
* Add short circuit if no live docs are in segments Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> --------- Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> (cherry picked from commit 7aedefd) Co-authored-by: Vijayan Balasubramanian <balasvij@amazon.com>
Description
Related Issues
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.