Skip to content

Commit 697ff57

Browse files
committed
Set default format_version to 5 for RocksDB databases (#4480)
(cherry picked from commit 8c7dea6)
1 parent 3b06ecf commit 697ff57

File tree

9 files changed

+15
-7
lines changed

9 files changed

+15
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ gcEntryLogMetadataCacheEnabled=false
779779
# dbStorage_rocksDB_numFilesInLevel0=4
780780
# dbStorage_rocksDB_maxSizeInLevel1MB=256
781781
# dbStorage_rocksDB_logPath=
782-
# dbStorage_rocksDB_format_version=2
782+
# dbStorage_rocksDB_format_version=5
783783

784784
#############################################################################
785785
## DirectIO entry logger configuration

conf/default_rocksdb.conf.default

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 1 deletion
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)