Skip to content

[kv] Implement KvTablet RocksDB Lazy Open #2913

@platinumhamburg

Description

@platinumhamburg

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

When a tablet server hosts thousands of KV buckets, all RocksDB instances are opened eagerly at startup, consuming significant memory. In practice, many buckets may receive no traffic for hours or even days — especially in multi-tenant or high-partition-count deployments. These idle RocksDB instances waste memory without serving any requests.

Solution

Defer RocksDB open to first access. Each KV tablet starts as a lightweight sentinel (no RocksDB). When the first read/write arrives, RocksDB is opened on demand. After a configurable idle timeout, the tablet is automatically released back to the lightweight state, preserving local SST files for fast reopen.

Anything else?

No response

Willingness to contribute

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions