Every blob read from disk gets inserted into the unified cache. Accessor::get in src/vlog/accessor.rs does it unconditionally:
let value = Reader::new(blob_file, &file).get(key, vhandle)?;
cache.insert_blob(tree_id, vhandle, value.clone());
I have a KV-separated keyspace holding large blobs that are mostly read once. It churns through the whole cache in seconds and leaves the index trees for my other keyspaces cold, even though those would fit in a few MB.
Suggested implementation
Add a policy to KvSeparationOptions, defaulting to current behavior:
pub enum BlobCachePolicy {
Always,
Never,
}
Thread it into Accessor::get and gate the insert. Lookups still hit the cache, they just stop populating it, so nothing changes for readers that already have the blob warm and the Cache type itself stays untouched.
Every blob read from disk gets inserted into the unified cache.
Accessor::getinsrc/vlog/accessor.rsdoes it unconditionally:I have a KV-separated keyspace holding large blobs that are mostly read once. It churns through the whole cache in seconds and leaves the index trees for my other keyspaces cold, even though those would fit in a few MB.
Suggested implementation
Add a policy to
KvSeparationOptions, defaulting to current behavior:Thread it into
Accessor::getand gate the insert. Lookups still hit the cache, they just stop populating it, so nothing changes for readers that already have the blob warm and theCachetype itself stays untouched.