-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[ENH] Validate HNSW index integrity on load #3369
[ENH] Validate HNSW index integrity on load #3369
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
@@ -94,6 +94,7 @@ class Index | |||
throw std::runtime_error("Index already inited"); | |||
} | |||
appr_alg = new hnswlib::HierarchicalNSW<dist_t>(l2space, path_to_index, false, 0, allow_replace_deleted, normalize, is_persistent_index); | |||
appr_alg->checkIntegrity(); |
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.
Can we add a rust level test that somehow corrupts the index and verifies we get the error?
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.
I've added a rust unit test that corrupts the index and verifies the error message.
b01f314
to
232c6d4
Compare
Description of changes
Summarize the changes made by this PR.
checkIntegrity()
method is added to theload()
method in the binding.Test plan
How are these changes tested?
This should not break any existing test cases
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?
N/A