-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] Fix HNSW resize conditions to exclude deleted items (#3424)
## Description of changes We were seeing errors in compaction that looked like: ``` WriteSegments(ApplyMaterializatedLogsError(HnswIndex(FFIException(\"The number of elements exceeds the specified limit\")))) ``` This is because the resize logic uses `len` which removes deleted elements which then causes the conditional for resizing to be skipped. This adds a new method `len_with_deleted` to return the length of the index including the elements that have been deleted so that the resize is not skipped. See: https://github.com/chroma-core/chroma/blob/27564afa0e82d184a0fa853a7384d00861d8e9dc/rust/worker/src/segment/distributed_hnsw_segment.rs#L212-L222 ## Test plan A test was added. It will fail when using the existing `len` method, but passes when using the newly added `len_with_deleted` method. - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes N/A Thanks to @sanketkedia for helping root cause this. Fixes chroma-core/hosted-chroma#855
- Loading branch information
1 parent
6145277
commit 514bda0
Showing
2 changed files
with
68 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
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