diff --git a/diskann-providers/src/model/graph/provider/async_/caching/bf_cache.rs b/diskann-providers/src/model/graph/provider/async_/caching/bf_cache.rs index 663fc8d0f..2612e7756 100644 --- a/diskann-providers/src/model/graph/provider/async_/caching/bf_cache.rs +++ b/diskann-providers/src/model/graph/provider/async_/caching/bf_cache.rs @@ -24,11 +24,9 @@ impl Cache { pub fn new(bytes: PowerOfTwo) -> diskann::ANNResult { let mut config = bf_tree::Config::default(); - // N.B.: When `https://github.com/gim-home/Bf-Tree/issues/59` is resolved, set - // `cache_only(true)`. But until then, keep this as false to prevent hangs. config .storage_backend(bf_tree::StorageBackend::Memory) - .cache_only(false) + .cache_only(true) .cb_size_byte(bytes.raw()); Ok(Self { @@ -1195,7 +1193,12 @@ mod tests { let utilization = cache.estimate_utilization(); - assert_eq!(utilization.used, 0); + assert!( + utilization.used <= utilization.capacity, + "cache utilization used ({}) must not exceed capacity ({})", + utilization.used, + utilization.capacity, + ); assert_eq!(utilization.capacity, capacity); let mut v = VecCacher::::new(128);