From 4ca020a5f0805a748a1e8d983015e5221a534fd7 Mon Sep 17 00:00:00 2001 From: Aurora Twinkle Date: Sun, 21 Jul 2024 05:48:11 +0800 Subject: [PATCH] fix[rocksdb]: fix error rocksdb default config for CFOptions (#4466) * fix[rocksdb]: fix error rocksdb default config for CFOptions --------- Co-authored-by: duanlinlin --- .../test/resources/conf/default_rocksdb.conf | 11 +++++++--- .../conf/entry_location_rocksdb.conf | 4 ++-- .../conf/ledger_metadata_rocksdb.conf | 11 +++++++--- .../test_entry_location_rocksdb.conf | 22 ++++++++++++++++++- conf/default_rocksdb.conf.default | 9 ++++++-- conf/entry_location_rocksdb.conf.default | 8 +++++-- conf/ledger_metadata_rocksdb.conf.default | 9 ++++++-- 7 files changed, 59 insertions(+), 15 deletions(-) diff --git a/bookkeeper-server/src/test/resources/conf/default_rocksdb.conf b/bookkeeper-server/src/test/resources/conf/default_rocksdb.conf index 0f3a08779ed..df433a33e96 100644 --- a/bookkeeper-server/src/test/resources/conf/default_rocksdb.conf +++ b/bookkeeper-server/src/test/resources/conf/default_rocksdb.conf @@ -23,7 +23,12 @@ info_log_level=INFO_LEVEL # set by jni: options.setKeepLogFileNum keep_log_file_num=30 - -[CFOptions "default"] # set by jni: options.setLogFileTimeToRoll - log_file_time_to_roll=86400 \ No newline at end of file + log_file_time_to_roll=86400 + + [CFOptions "default"] + #no default setting in CFOptions + +[TableOptions/BlockBasedTable "default"] + # set by jni: tableOptions.setChecksumType + checksum=kxxHash \ No newline at end of file diff --git a/bookkeeper-server/src/test/resources/conf/entry_location_rocksdb.conf b/bookkeeper-server/src/test/resources/conf/entry_location_rocksdb.conf index 6f6c1b4d052..260111fa140 100644 --- a/bookkeeper-server/src/test/resources/conf/entry_location_rocksdb.conf +++ b/bookkeeper-server/src/test/resources/conf/entry_location_rocksdb.conf @@ -26,7 +26,7 @@ # set by jni: options.setLogFileTimeToRoll log_file_time_to_roll=86400 # set by jni: options.setMaxBackgroundJobs or options.setIncreaseParallelism - max_background_jobs=2 + max_background_jobs=32 # set by jni: options.setMaxSubcompactions max_subcompactions=1 # set by jni: options.setMaxTotalWalSize @@ -57,7 +57,7 @@ [TableOptions/BlockBasedTable "default"] # set by jni: tableOptions.setBlockSize block_size=65536 - # set by jni: tableOptions.setBlockCache +# set by jni: tableOptions.setBlockCache, default value is: maxDirectMemory() / ledgerDirsSize / 10; block_cache=206150041 # set by jni: tableOptions.setFormatVersion format_version=2 diff --git a/bookkeeper-server/src/test/resources/conf/ledger_metadata_rocksdb.conf b/bookkeeper-server/src/test/resources/conf/ledger_metadata_rocksdb.conf index 0f3a08779ed..f84c0167ed7 100644 --- a/bookkeeper-server/src/test/resources/conf/ledger_metadata_rocksdb.conf +++ b/bookkeeper-server/src/test/resources/conf/ledger_metadata_rocksdb.conf @@ -23,7 +23,12 @@ info_log_level=INFO_LEVEL # set by jni: options.setKeepLogFileNum keep_log_file_num=30 - -[CFOptions "default"] # set by jni: options.setLogFileTimeToRoll - log_file_time_to_roll=86400 \ No newline at end of file + log_file_time_to_roll=86400 + + [CFOptions "default"] + #no default setting in CFOptions + +[TableOptions/BlockBasedTable "default"] + # set by jni: tableOptions.setChecksumType + checksum=kxxHash \ No newline at end of file diff --git a/bookkeeper-server/src/test/resources/test_entry_location_rocksdb.conf b/bookkeeper-server/src/test/resources/test_entry_location_rocksdb.conf index 9d1c3e08c47..f0971b8d310 100644 --- a/bookkeeper-server/src/test/resources/test_entry_location_rocksdb.conf +++ b/bookkeeper-server/src/test/resources/test_entry_location_rocksdb.conf @@ -19,10 +19,22 @@ [DBOptions] # set by jni: options.setCreateIfMissing create_if_missing=true + # set by jni: options.setInfoLogLevel + info_log_level=INFO_LEVEL # set by jni: options.setKeepLogFileNum keep_log_file_num=1 + # set by jni: options.setLogFileTimeToRoll + log_file_time_to_roll=86400 + # set by jni: options.setMaxBackgroundJobs or options.setIncreaseParallelism + max_background_jobs=32 + # set by jni: options.setMaxSubcompactions + max_subcompactions=1 # set by jni: options.setMaxTotalWalSize max_total_wal_size=1000 + # set by jni: options.setMaxOpenFiles + max_open_files=-1 + # set by jni: options.setDeleteObsoleteFilesPeriodMicros + delete_obsolete_files_period_micros=3600000000 [CFOptions "default"] # set by jni: options.setCompressionType @@ -31,13 +43,21 @@ write_buffer_size=1024 # set by jni: options.setMaxWriteBufferNumber max_write_buffer_number=1 + # set by jni: options.setNumLevels + num_levels=7 + # set by jni: options.setLevelZeroFileNumCompactionTrigger + level0_file_num_compaction_trigger=4 + # set by jni: options.setMaxBytesForLevelBase + max_bytes_for_level_base=268435456 + # set by jni: options.setTargetFileSizeBase + target_file_size_base=67108864 # set by jni: options.setLevelCompactionDynamicLevelBytes level_compaction_dynamic_level_bytes=true [TableOptions/BlockBasedTable "default"] # set by jni: tableOptions.setBlockSize block_size=65536 - # set by jni: tableOptions.setBlockCache +# set by jni: tableOptions.setBlockCache, default value is: maxDirectMemory() / ledgerDirsSize / 10; block_cache=206150041 # set by jni: tableOptions.setFormatVersion format_version=2 diff --git a/conf/default_rocksdb.conf.default b/conf/default_rocksdb.conf.default index e9b8e7c3ecd..d8a77dd9d3f 100644 --- a/conf/default_rocksdb.conf.default +++ b/conf/default_rocksdb.conf.default @@ -16,6 +16,10 @@ # * limitations under the License. # */ +# When modifying this file, please also modify the configuration files(at +# bookkeeper-server/src/test/resources/conf) in the +# test case to ensure unit test coverage. + [DBOptions] # set by jni: options.setCreateIfMissing create_if_missing=true @@ -23,11 +27,12 @@ info_log_level=INFO_LEVEL # set by jni: options.setKeepLogFileNum keep_log_file_num=30 - -[CFOptions "default"] # set by jni: options.setLogFileTimeToRoll log_file_time_to_roll=86400 + [CFOptions "default"] + #no default setting in CFOptions + [TableOptions/BlockBasedTable "default"] # set by jni: tableOptions.setChecksumType checksum=kxxHash \ No newline at end of file diff --git a/conf/entry_location_rocksdb.conf.default b/conf/entry_location_rocksdb.conf.default index 6f6c1b4d052..4d5ce58a859 100644 --- a/conf/entry_location_rocksdb.conf.default +++ b/conf/entry_location_rocksdb.conf.default @@ -16,6 +16,10 @@ # * limitations under the License. # */ +# When modifying this file, please also modify the configuration files(at +# bookkeeper-server/src/test/resources/conf) in the +# test case to ensure unit test coverage. + [DBOptions] # set by jni: options.setCreateIfMissing create_if_missing=true @@ -26,7 +30,7 @@ # set by jni: options.setLogFileTimeToRoll log_file_time_to_roll=86400 # set by jni: options.setMaxBackgroundJobs or options.setIncreaseParallelism - max_background_jobs=2 + max_background_jobs=32 # set by jni: options.setMaxSubcompactions max_subcompactions=1 # set by jni: options.setMaxTotalWalSize @@ -57,7 +61,7 @@ [TableOptions/BlockBasedTable "default"] # set by jni: tableOptions.setBlockSize block_size=65536 - # set by jni: tableOptions.setBlockCache + # set by jni: tableOptions.setBlockCache, default value is: maxDirectMemory() / ledgerDirsSize / 10; block_cache=206150041 # set by jni: tableOptions.setFormatVersion format_version=2 diff --git a/conf/ledger_metadata_rocksdb.conf.default b/conf/ledger_metadata_rocksdb.conf.default index e9b8e7c3ecd..0bf79349220 100644 --- a/conf/ledger_metadata_rocksdb.conf.default +++ b/conf/ledger_metadata_rocksdb.conf.default @@ -16,6 +16,10 @@ # * limitations under the License. # */ +# When modifying this file, please also modify the configuration files(at +# bookkeeper-server/src/test/resources/conf) in the +# test case to ensure unit test coverage. + [DBOptions] # set by jni: options.setCreateIfMissing create_if_missing=true @@ -23,10 +27,11 @@ info_log_level=INFO_LEVEL # set by jni: options.setKeepLogFileNum keep_log_file_num=30 - -[CFOptions "default"] # set by jni: options.setLogFileTimeToRoll log_file_time_to_roll=86400 + + [CFOptions "default"] + #no default setting in CFOptions [TableOptions/BlockBasedTable "default"] # set by jni: tableOptions.setChecksumType