A question about changing Compaction Style for a running cluster.
I have a cluster running multiple RocksDB instances, all of which currently use RocksDB's default compaction strategy—Leveled Compaction. I am considering switching the entire cluster to Universal Compaction but am uncertain about potential compatibility issues. Does the RocksDB official team have any constructive recommendations or best practices for this migration? Thank you for your guidance.
It is generally safe to switch between level and universal compaction styles. You may see some additional compactions after you switch the compaction style, as the new compaction style reshapes the LSM tree. You should configure a sufficient num_levels so that DB open doesn't fail with error like "db has more levels than options.num_levels". Using a large num_levels (such as 50) should not have performance impact on Level compaction with level_compaction_dynamic_level_bytes=true (default) and universal compaction.