Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that formatVersion is specified for all RocksDB databases #4559

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private RocksDB initializeRocksDBWithBookieConf(String basePath, String subPath,
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 */
Expand All @@ -198,7 +199,6 @@ private RocksDB initializeRocksDBWithBookieConf(String basePath, String subPath,
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);
Expand Down Expand Up @@ -235,6 +235,7 @@ private RocksDB initializeRocksDBWithBookieConf(String basePath, String subPath,
} else {
this.cache = null;
BlockBasedTableConfig tableOptions = new BlockBasedTableConfig();
tableOptions.setFormatVersion(formatVersion);
tableOptions.setChecksumType(checksumType);
options.setTableFormatConfig(tableOptions);
}
Expand Down
Loading