Skip to content

kvdb-rocksdb: optional per-column storage path#979

Draft
x3c41a wants to merge 2 commits into
paritytech:masterfrom
x3c41a:cf-paths
Draft

kvdb-rocksdb: optional per-column storage path#979
x3c41a wants to merge 2 commits into
paritytech:masterfrom
x3c41a:cf-paths

Conversation

@x3c41a

@x3c41a x3c41a commented Jul 8, 2026

Copy link
Copy Markdown

Adds ColumnConfig.path so a single column family's SST files can be placed on a separate directory, letting a large cold column live on a cheaper volume while the rest of the DB stays on the main disk.

When path is set, column_config gives that column a single cf_paths entry with a max target size, which pins the column to that directory (RocksDB does not spill elsewhere, and cf_paths overrides db_paths for that column). Empty by default, so existing databases and single-volume setups are unaffected. column_config now returns io::Result to surface an invalid path.

Motivation: Polkadot Bulletin Chain wants to keep its bulk indexed-transaction column on cheap SSD/HDD while consensus state stays on NVMe.

Note: cf_paths affects only where new SST files are written; relocating an already-populated column needs a compaction or resync.

Depends on rust-rocksdb exposing Options::set_cf_paths (rust-rocksdb/rust-rocksdb#1094); compiles and runs against that change locally.

Draft for discussion.

x3c41a added 2 commits July 8, 2026 16:41
Add `ColumnConfig.path` so a column family's SST files can be placed on a separate
directory - a large cold column can then live on a cheaper volume while the rest of
the database stays on the main disk. When set, `column_config` gives that column a
single `cf_paths` entry with a max target size, which pins it to that directory
(RocksDB never spills elsewhere). `column_config` now returns `io::Result` to surface
a bad path. Empty by default, so existing databases are unaffected.

Depends on rust-rocksdb exposing `Options::set_cf_paths`
(rust-rocksdb/rust-rocksdb#1094).
@x3c41a

x3c41a commented Jul 14, 2026

Copy link
Copy Markdown
Author

Heads up on CI: the compile failure (no method named set_cf_paths) is expected for now. Options::set_cf_paths was merged upstream in rust-rocksdb#1092 but is not in a published rocksdb release yet (latest crate is 0.24.0, which predates the merge). This PR will build once rust-rocksdb cuts a release including #1092 and the rocksdb dependency here is bumped to it. Keeping this as a draft until then. (Rustfmt is now fixed.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant