FFFF
Skip to content

Allow bypassing the cache for blob reads #313

Description

@styris-ame

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0