Skip to content

fullhistory: scope the txhash tuning knobs to the txhash CF (#838)#849

Draft
chowbao wants to merge 2 commits into
chore/fullhistory-hardening-840from
chore/fullhistory-percf-tuning-838
Draft

fullhistory: scope the txhash tuning knobs to the txhash CF (#838)#849
chowbao wants to merge 2 commits into
chore/fullhistory-hardening-840from
chore/fullhistory-percf-tuning-838

Conversation

@chowbao

@chowbao chowbao commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Closes #838.

The shared hot-chunk config applied txhash's Tuning — 12-bit blooms, 64 MB write buffers, the 999/999/999 no-compaction triggers — to the ledgers and events CFs too; the per-CF overrides reclaimed only compression and block size. The ledgers CF paid for a bloom filter nothing consults (it is never probed for missing keys), and every CF's memtables were sized for txhash's write pattern.

Commit 1 grows rocksdb.CFOptions with the memtable/compaction/bloom knobs that were DB-wide Tuning fields (each still zero-means-default), and moves the bloom construction to the per-CF override. Tuning now carries only the genuinely DB-wide resources: block cache, WAL cap, background jobs, open-file cap. The one-shared-NewBloomFilter-moved-into-the-first-BBTO hazard doesn't regress: the filter is still constructed fresh per CF, now only for CFs that opt in.

Commit 2 scopes the values. Per the issue's sharpened scope this is a mechanical port of each store's pre-unification standalone tuning (verified against c445557d^, the parent of the multi-CF collapse):

CF before this PR after (== standalone)
txhash full calibration keeps everything: bloom 12, 64 MB × 2 memtables, L0 999s + DisableAutoCompactions, 64 MB target files, MaxBytesForLevelBase 256 MB
ledgers inherited txhash's knobs RocksDB defaults, no bloom (standalone ledger store set no Tuning at all)
events (3 CFs) txhash's knobs + own overrides only its own ZSTD + block-size overrides, no bloom

DB-wide consolidation: the standalone txhash instance was the only one that set the shared resources (512 MB block cache, 1 GB WAL cap, 8 background jobs, 10k open files; ledger/events rode on defaults), so keeping txhash's values on the shared DB is exactly the three instances' combined footprint — no re-sizing needed.

Tests: TestConfig_PerCFOptionRouting pins the routing at the config-construction seam (txhash CF keeps bloom/buffers/no-compaction; ledgers CF gets none of them; events keeps ZSTD/block size, no bloom), TestConfig_DBWideTuningStaysShared pins the shared values, and the existing rocksdb round-trip test now exercises the knobs through PerCFOptions. Full fullhistory -short suite and -race on rocksdb/hotchunk pass.

chowbao added 2 commits July 9, 2026 22:57
Grow CFOptions with the memtable, compaction, and bloom knobs that were
DB-wide fields on Tuning, and route the bloom filter through the per-CF
override. Tuning now carries only the genuinely DB-wide resources shared
across every CF of one store: block cache, WAL cap, background jobs, and
open-file cap.

This lets a facade scope a workload's tuning to the CF that has that
workload instead of leaking it onto every CF in the shared per-chunk DB.
Split txhash's config into the DB-wide Tuning it always set (block cache,
WAL cap, background jobs, open files) and a new CFOptions carrying its
per-CF workload knobs (bloom, write buffers, compaction triggers). The
hotchunk opener merges the per-CF options from every facade so those
knobs land on the txhash CF alone.

Restores each store's pre-unification standalone tuning: the ledgers CF
runs with no bloom filter (it is never probed for missing keys) and
default memtables/compaction; the events CFs keep their ZSTD and
block-size overrides; the txhash CF keeps its full calibration. The
DB-wide resources stay shared, sized to what the three standalone
instances used together (only txhash set them).
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