This repository contains scripts to reproduce a (believed to be) bug within RocksDB that does not let you reduce the levels of a database created from SST files with multiple column families, even when specifying CLI options.
- Install Go 1.26.0 from here: https://go.dev/dl/. The Go version should not matter as long as it is >= 1.25.0
- Run
bash ./install_rocksdb.shto download and compile and install RocksDB v10.10.1 from source. You may need to run this withsudo. - Run
bash ./build.shto build the executablerocksdb-sst-repro, which will be used to create SST files - Run
mkdir data/and then./rocksdb-sst-reproto create SST files for this reproduction - Run
bash ./ingest.shto ingest the SST files into the directoryingested_data/(created automatically) - Run
bash ./compact_and_reduce.shto compact the database and reduce it to 3 levels. Compaction should work but level reduction should fail.
Running the following commands (besides the one in compact_and_reduce.sh) will still result in reduce_levels failing:
./rocksdb-10.10.1/ldb --db=ingested_data/ reduce_levels --new_levels=3 --print_old_levels --column_family=default
./rocksdb-10.10.1/ldb --db=ingested_data/ reduce_levels --new_levels=3 --print_old_levels --column_family=othercf
./rocksdb-10.10.1/ldb --db=ingested_data/ reduce_levels --new_levels=3 --print_old_levels --column_family=default,othercf
./rocksdb-10.10.1/ldb --db=ingested_data/ reduce_levels --new_levels=3 --print_old_levels --column_family="default,othercf"
The error message returned will always be: Failed: Invalid argument: Column families not opened: othercf