This is an automated email from the ASF dual-hosted git repository.

lushiji pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d8b927945 Ensure that formatVersion is specified for all RocksDB dbs 
(#4559)
4d8b927945 is described below

commit 4d8b927945a4f235c4a91b3fc7387fa7bf939c0d
Author: Lari Hotari <[email protected]>
AuthorDate: Tue Apr 1 17:58:10 2025 +0300

    Ensure that formatVersion is specified for all RocksDB dbs (#4559)
---
 .../apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
index 0c13c1c8bf..22c5bc75db 100644
--- 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
+++ 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/KeyValueStorageRocksDB.java
@@ -182,6 +182,7 @@ public class KeyValueStorageRocksDB implements 
KeyValueStorage {
         Options options = new Options();
         options.setCreateIfMissing(true);
         ChecksumType checksumType = 
ChecksumType.valueOf(conf.getString(ROCKSDB_CHECKSUM_TYPE, "kxxHash"));
+        int formatVersion = conf.getInt(ROCKSDB_FORMAT_VERSION, 5);
 
         if (dbConfigType == DbConfigType.EntryLocation) {
             /* Set default RocksDB block-cache size to 10% / numberOfLedgers 
of direct memory, unless override */
@@ -198,7 +199,6 @@ public class KeyValueStorageRocksDB implements 
KeyValueStorage {
             int blockSize = conf.getInt(ROCKSDB_BLOCK_SIZE, 64 * 1024);
             int bloomFilterBitsPerKey = 
conf.getInt(ROCKSDB_BLOOM_FILTERS_BITS_PER_KEY, 10);
             boolean lz4CompressionEnabled = 
conf.getBoolean(ROCKSDB_LZ4_COMPRESSION_ENABLED, true);
-            int formatVersion = conf.getInt(ROCKSDB_FORMAT_VERSION, 5);
 
             if (lz4CompressionEnabled) {
                 options.setCompressionType(CompressionType.LZ4_COMPRESSION);
@@ -235,6 +235,7 @@ public class KeyValueStorageRocksDB implements 
KeyValueStorage {
         } else {
             this.cache = null;
             BlockBasedTableConfig tableOptions = new BlockBasedTableConfig();
+            tableOptions.setFormatVersion(formatVersion);
             tableOptions.setChecksumType(checksumType);
             options.setTableFormatConfig(tableOptions);
         }

Reply via email to