Make format_version=5 new default (#8017)

Summary:
Haven't seen any production issues with new Bloom filter and
it's now > 1 year old (added in 6.6.0).

Updated check_format_compatible.sh and HISTORY.md

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8017

Test Plan: tests updated (or prior bugs fixed)

Reviewed By: ajkr

Differential Revision: D26762197

Pulled By: pdillinger

fbshipit-source-id: 0e755c46b443087c1544da0fd545beb9c403d1c2
This commit is contained in:
Peter Dillinger 2021-03-09 12:41:15 -08:00 committed by Facebook GitHub Bot
parent 430842f948
commit 0028e3398b
7 changed files with 10 additions and 7 deletions

View File

@ -7,6 +7,7 @@
* Add a new option BlockBasedTableOptions::max_auto_readahead_size. RocksDB does auto-readahead for iterators on noticing more than two reads for a table file if user doesn't provide readahead_size. The readahead starts at 8KB and doubles on every additional read upto max_auto_readahead_size and now max_auto_readahead_size can be configured dynamically as well. Found that 256 KB readahead size provides the best performance, based on experiments, for auto readahead. Experiment data is in PR #3282. If value is set 0 then no automatic prefetching will be done by rocksdb. Also changing the value will only affect files opened after the change. * Add a new option BlockBasedTableOptions::max_auto_readahead_size. RocksDB does auto-readahead for iterators on noticing more than two reads for a table file if user doesn't provide readahead_size. The readahead starts at 8KB and doubles on every additional read upto max_auto_readahead_size and now max_auto_readahead_size can be configured dynamically as well. Found that 256 KB readahead size provides the best performance, based on experiments, for auto readahead. Experiment data is in PR #3282. If value is set 0 then no automatic prefetching will be done by rocksdb. Also changing the value will only affect files opened after the change.
* Add suppport to extend DB::VerifyFileChecksums API to also verify blob files checksum. * Add suppport to extend DB::VerifyFileChecksums API to also verify blob files checksum.
* When using the new BlobDB, the amount of data written by flushes/compactions is now broken down into table files and blob files in the compaction statistics; namely, Write(GB) denotes the amount of data written to table files, while Wblob(GB) means the amount of data written to blob files. * When using the new BlobDB, the amount of data written by flushes/compactions is now broken down into table files and blob files in the compaction statistics; namely, Write(GB) denotes the amount of data written to table files, while Wblob(GB) means the amount of data written to blob files.
* New default BlockBasedTableOptions::format_version=5 to enable new Bloom filter implementation by default, compatible with RocksDB versions >= 6.6.0.
* Add new SetBufferSize API to WriteBufferManager to allow dynamic management of memory allotted to all write buffers. This allows user code to adjust memory monitoring provided by WriteBufferManager as process memory needs change datasets grow and shrink. * Add new SetBufferSize API to WriteBufferManager to allow dynamic management of memory allotted to all write buffers. This allows user code to adjust memory monitoring provided by WriteBufferManager as process memory needs change datasets grow and shrink.
* Clarified the required semantics of Read() functions in FileSystem and Env APIs. Please ensure any custom implementations are compliant. * Clarified the required semantics of Read() functions in FileSystem and Env APIs. Please ensure any custom implementations are compliant.
* For the new integrated BlobDB implementation, compaction statistics now include the amount of data read from blob files during compaction (due to garbage collection or compaction filters). Write amplification metrics have also been extended to account for data read from blob files. * For the new integrated BlobDB implementation, compaction statistics now include the amount of data read from blob files during compaction (due to garbage collection or compaction filters). Write amplification metrics have also been extended to account for data read from blob files.

View File

@ -1119,9 +1119,8 @@ int main(int argc, char** argv) {
// Essentially a fingerprint of the block-based Bloom schema // Essentially a fingerprint of the block-based Bloom schema
CheckCondition(hits == 241); CheckCondition(hits == 241);
} else { } else {
// Essentially a fingerprint of the full Bloom schema(s), // Essentially a fingerprint of full Bloom schema, format_version=5
// format_version < 5, which vary for three different CACHE_LINE_SIZEs CheckCondition(hits == 188);
CheckCondition(hits == 224 || hits == 180 || hits == 125);
} }
CheckCondition( CheckCondition(
(keys_to_query - hits) == (keys_to_query - hits) ==

View File

@ -500,6 +500,7 @@ Options DBTestBase::GetOptions(
break; break;
} }
case kBlockBasedTableWithPartitionedIndex: { case kBlockBasedTableWithPartitionedIndex: {
table_options.format_version = 3;
table_options.index_type = BlockBasedTableOptions::kTwoLevelIndexSearch; table_options.index_type = BlockBasedTableOptions::kTwoLevelIndexSearch;
options.prefix_extractor.reset(NewNoopTransform()); options.prefix_extractor.reset(NewNoopTransform());
break; break;

View File

@ -391,7 +391,7 @@ struct BlockBasedTableOptions {
// 5 -- Can be read by RocksDB's versions since 6.6.0. Full and partitioned // 5 -- Can be read by RocksDB's versions since 6.6.0. Full and partitioned
// filters use a generally faster and more accurate Bloom filter // filters use a generally faster and more accurate Bloom filter
// implementation, with a different schema. // implementation, with a different schema.
uint32_t format_version = 4; uint32_t format_version = 5;
// Store index blocks on disk in compressed format. Changing this option to // Store index blocks on disk in compressed format. Changing this option to
// false will avoid the overhead of decompression if index blocks are evicted // false will avoid the overhead of decompression if index blocks are evicted

View File

@ -38,7 +38,7 @@ public class BlockBasedTableConfig extends TableFormatConfig {
wholeKeyFiltering = true; wholeKeyFiltering = true;
verifyCompression = false; verifyCompression = false;
readAmpBytesPerBit = 0; readAmpBytesPerBit = 0;
formatVersion = 4; formatVersion = 5;
enableIndexCompression = true; enableIndexCompression = true;
blockAlign = false; blockAlign = false;
indexShortening = IndexShorteningMode.kShortenSeparators; indexShortening = IndexShorteningMode.kShortenSeparators;

View File

@ -3921,6 +3921,8 @@ TEST_P(IndexBlockRestartIntervalTest, IndexBlockRestartInterval) {
table_options.index_block_restart_interval = index_block_restart_interval; table_options.index_block_restart_interval = index_block_restart_interval;
if (value_delta_encoding) { if (value_delta_encoding) {
table_options.format_version = 4; table_options.format_version = 4;
} else {
table_options.format_version = 3;
} }
options.table_factory.reset(new BlockBasedTableFactory(table_options)); options.table_factory.reset(new BlockBasedTableFactory(table_options));

View File

@ -117,7 +117,7 @@ EOF
# To check for DB forward compatibility with loading options (old version # To check for DB forward compatibility with loading options (old version
# reading data from new), as well as backward compatibility # reading data from new), as well as backward compatibility
declare -a db_forward_with_options_refs=("5.16.fb" "5.17.fb" "5.18.fb" "6.0.fb" "6.1.fb" "6.2.fb" "6.3.fb" "6.4.fb" "6.5.fb" "6.6.fb" "6.7.fb" "6.8.fb" "6.9.fb" "6.10.fb" "6.11.fb" "6.12.fb" "6.13.fb" "6.14.fb" "6.15.fb" "6.16.fb" "6.17.fb") declare -a db_forward_with_options_refs=("6.6.fb" "6.7.fb" "6.8.fb" "6.9.fb" "6.10.fb" "6.11.fb" "6.12.fb" "6.13.fb" "6.14.fb" "6.15.fb" "6.16.fb" "6.17.fb")
# To check for DB forward compatibility without loading options (in addition # To check for DB forward compatibility without loading options (in addition
# to the "with loading options" set), as well as backward compatibility # to the "with loading options" set), as well as backward compatibility
declare -a db_forward_no_options_refs=() # N/A at the moment declare -a db_forward_no_options_refs=() # N/A at the moment
@ -125,7 +125,7 @@ declare -a db_forward_no_options_refs=() # N/A at the moment
# To check for SST ingestion backward compatibility (new version reading # To check for SST ingestion backward compatibility (new version reading
# data from old) (ldb ingest_extern_sst added in 5.16.x, back-ported to # data from old) (ldb ingest_extern_sst added in 5.16.x, back-ported to
# 5.14.x, 5.15.x) # 5.14.x, 5.15.x)
declare -a ext_backward_only_refs=("5.14.fb" "5.15.fb") declare -a ext_backward_only_refs=("5.14.fb" "5.15.fb" "5.16.fb" "5.17.fb" "5.18.fb" "6.0.fb" "6.1.fb" "6.2.fb" "6.3.fb" "6.4.fb" "6.5.fb")
# To check for SST ingestion forward compatibility (old version reading # To check for SST ingestion forward compatibility (old version reading
# data from new) as well as backward compatibility # data from new) as well as backward compatibility
declare -a ext_forward_refs=("${db_forward_no_options_refs[@]}" "${db_forward_with_options_refs[@]}") declare -a ext_forward_refs=("${db_forward_no_options_refs[@]}" "${db_forward_with_options_refs[@]}")