When rpc-history is enabled on a validator, blockstore will create additional RocksDB column families.
The keys of those rpc-related column families are pubkey-prefixed for faster prefix-scan operation.
As a result, their underlying RocksDB SST files are not sorted by slot and thus their disk space reclaiming is less performant than other slot-based column families as our disk space reclaiming logic is slot-based.
This makes IO spikes when the periodic compaction starts.
Proposed Solution
The problem is fundamentally challenging as it's impossible to have one key format that satisfies both read and compaction as they require different key prefixes. However, the IO spike issue can be mitigated by using RocksDB's RateLimiter which will smooth out the IO spikes.
Problem
When rpc-history is enabled on a validator, blockstore will create additional RocksDB column families. The keys of those rpc-related column families are pubkey-prefixed for faster prefix-scan operation. As a result, their underlying RocksDB SST files are not sorted by slot and thus their disk space reclaiming is less performant than other slot-based column families as our disk space reclaiming logic is slot-based.
This makes IO spikes when the periodic compaction starts.
Proposed Solution
The problem is fundamentally challenging as it's impossible to have one key format that satisfies both read and compaction as they require different key prefixes. However, the IO spike issue can be mitigated by using RocksDB's RateLimiter which will smooth out the IO spikes.