Skip to content

Commit 1b4777a

Browse files
authored
[BUG]: Prevent hnsw cleanup if use_direct_hnsw is true (#5933)
## Description of changes As titled. - Improvements & Bug fixes - ... - New functionality - ... ## Test plan _How are these changes tested?_ - [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Migration plan _Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?_ ## Observability plan _What is the plan to instrument and monitor this change?_ ## Documentation Changes _Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
1 parent b039933 commit 1b4777a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

rust/index/src/hnsw_provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub struct HnswIndexProvider {
6060
// TODO(tanujnay112): This feature flag is a temporary measure to gate
6161
// the hnsw loading from memory feature. Remove this after that feature
6262
// stabilizes.
63-
use_direct_hnsw: bool,
63+
pub use_direct_hnsw: bool,
6464
}
6565

6666
pub struct HnswIndexFlusher {

rust/worker/src/execution/orchestration/compact.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,11 @@ impl CompactionContext {
834834
}
835835

836836
pub(crate) async fn cleanup(self) {
837+
if self.hnsw_provider.use_direct_hnsw {
838+
return;
839+
}
840+
841+
// TODO(tanujnay112): Remove when use_direct_hnsw is fully deprecated
837842
for hnsw_index_uuid in self.hnsw_index_uuids {
838843
let _ = HnswIndexProvider::purge_one_id(
839844
self.hnsw_provider.temporary_storage_path.as_path(),

0 commit comments

Comments
 (0)