Skip to content

Commit 8c7dea6

Browse files
authored
Set default format_version to 5 for RocksDB databases (#4480)
1 parent 999cd0f commit 8c7dea6

9 files changed

+15
-7
lines changed

bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private RocksDB initializeRocksDBWithBookieConf(String basePath, String subPath,
198198
int blockSize = conf.getInt(ROCKSDB_BLOCK_SIZE, 64 * 1024);
199199
int bloomFilterBitsPerKey = conf.getInt(ROCKSDB_BLOOM_FILTERS_BITS_PER_KEY, 10);
200200
boolean lz4CompressionEnabled = conf.getBoolean(ROCKSDB_LZ4_COMPRESSION_ENABLED, true);
201-
int formatVersion = conf.getInt(ROCKSDB_FORMAT_VERSION, 2);
201+
int formatVersion = conf.getInt(ROCKSDB_FORMAT_VERSION, 5);
202202

203203
if (lz4CompressionEnabled) {
204204
options.setCompressionType(CompressionType.LZ4_COMPRESSION);

bookkeeper-server/src/test/resources/conf/default_rocksdb.conf

+2
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@
3030
#no default setting in CFOptions
3131

3232
[TableOptions/BlockBasedTable "default"]
33+
# set by jni: tableOptions.setFormatVersion
34+
format_version=5
3335
# set by jni: tableOptions.setChecksumType
3436
checksum=kxxHash

bookkeeper-server/src/test/resources/conf/entry_location_rocksdb.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
# set by jni: tableOptions.setBlockCache, default value is: maxDirectMemory() / ledgerDirsSize / 10;
6161
block_cache=206150041
6262
# set by jni: tableOptions.setFormatVersion
63-
format_version=2
63+
format_version=5
6464
# set by jni: tableOptions.setChecksumType
6565
checksum=kxxHash
6666
# set by jni: tableOptions.setFilterPolicy, bloomfilter:[bits_per_key]:[use_block_based_builder]

bookkeeper-server/src/test/resources/conf/ledger_metadata_rocksdb.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
keep_log_file_num=30
2626
# set by jni: options.setLogFileTimeToRoll
2727
log_file_time_to_roll=86400
28-
28+
2929
[CFOptions "default"]
3030
#no default setting in CFOptions
3131

3232
[TableOptions/BlockBasedTable "default"]
33+
# set by jni: tableOptions.setFormatVersion
34+
format_version=5
3335
# set by jni: tableOptions.setChecksumType
3436
checksum=kxxHash

bookkeeper-server/src/test/resources/test_entry_location_rocksdb.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
# set by jni: tableOptions.setBlockCache, default value is: maxDirectMemory() / ledgerDirsSize / 10;
6161
block_cache=206150041
6262
# set by jni: tableOptions.setFormatVersion
63-
format_version=2
63+
format_version=5
6464
# set by jni: tableOptions.setChecksumType
6565
checksum=kxxHash
6666
# set by jni: tableOptions.setFilterPolicy, bloomfilter:[bits_per_key]:[use_block_based_builder]

conf/bk_server.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ gcEntryLogMetadataCacheEnabled=false
777777
# dbStorage_rocksDB_numFilesInLevel0=4
778778
# dbStorage_rocksDB_maxSizeInLevel1MB=256
779779
# dbStorage_rocksDB_logPath=
780-
# dbStorage_rocksDB_format_version=2
780+
# dbStorage_rocksDB_format_version=5
781781

782782
#############################################################################
783783
## DirectIO entry logger configuration

conf/default_rocksdb.conf.default

+2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@
3434
#no default setting in CFOptions
3535

3636
[TableOptions/BlockBasedTable "default"]
37+
# set by jni: tableOptions.setFormatVersion
38+
format_version=5
3739
# set by jni: tableOptions.setChecksumType
3840
checksum=kxxHash

conf/entry_location_rocksdb.conf.default

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# set by jni: tableOptions.setBlockCache, default value is: maxDirectMemory() / ledgerDirsSize / 10;
6565
block_cache=206150041
6666
# set by jni: tableOptions.setFormatVersion
67-
format_version=2
67+
format_version=5
6868
# set by jni: tableOptions.setChecksumType
6969
checksum=kxxHash
7070
# set by jni: tableOptions.setFilterPolicy, bloomfilter:[bits_per_key]:[use_block_based_builder]

conf/ledger_metadata_rocksdb.conf.default

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
keep_log_file_num=30
3030
# set by jni: options.setLogFileTimeToRoll
3131
log_file_time_to_roll=86400
32-
32+
3333
[CFOptions "default"]
3434
#no default setting in CFOptions
3535

3636
[TableOptions/BlockBasedTable "default"]
37+
# set by jni: tableOptions.setFormatVersion
38+
format_version=5
3739
# set by jni: tableOptions.setChecksumType
3840
checksum=kxxHash

0 commit comments

Comments
 (0)