Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvdb-rocksdb: set format_version to 5 #395

Merged
merged 2 commits into from
Jul 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
ordian marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -1106,7 +1109,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"));
}
}