Skip to content

Commit

Permalink
kvdb-rocksdb: set format_version to 5 (#395)
Browse files Browse the repository at this point in the history
* kvdb-rocksdb: set format_version to 5

* Update kvdb-rocksdb/src/lib.rs

Co-authored-by: David <dvdplm@gmail.com>

Co-authored-by: David <dvdplm@gmail.com>
  • Loading branch information
ordian and dvdplm authored Jul 27, 2020
1 parent 4a7afbb commit c3d4d3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kvdb-rocksdb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ fn generate_read_options() -> ReadOptions {
fn generate_block_based_options(config: &DatabaseConfig) -> BlockBasedOptions {
let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(config.compaction.block_size);
// See https://github.com/facebook/rocksdb/blob/a1523efcdf2f0e8133b9a9f6e170a0dad49f928f/include/rocksdb/table.h#L246-L271 for details on what the format versions are/do.
block_opts.set_format_version(5);
block_opts.set_block_restart_interval(16);
// Set cache size as recommended by
// https://github.com/facebook/rocksdb/wiki/Setup-Options-and-Basic-Tuning#block-cache-size
let cache_size = config.memory_budget() / 3;
Expand Down Expand Up @@ -1111,7 +1114,7 @@ rocksdb.db.get.micros P50 : 2.000000 P95 : 3.000000 P99 : 4.000000 P100 : 5.0000
// Don't fsync every store
assert!(settings.contains("Options.use_fsync: 0"));

// We're using the old format
assert!(settings.contains("format_version: 2"));
// We're using the new format
assert!(settings.contains("format_version: 5"));
}
}

0 comments on commit c3d4d3d

Please sign in to comment.