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

BUG FIX: set target file size multiplier #1704

Merged

Conversation

yehaolan
Copy link
Contributor

@yehaolan yehaolan commented Aug 7, 2024

Overview

documentation of targetFileSizeBase and targetFileSizeMultiplier is located here (texted copied below)

targetFileSizeBase determines a level-1 file size. Target file size for level L can be calculated by targetFileSizeBase * (targetFileSizeMultiplier ^ (L-1)) For example, if targetFileSizeBase is 2MB and target_file_size_multiplier is 10, then each file on level-1 will be 2MB, and each file on level 2 will be 20MB, and each file on level-3 will be 200MB. by default targetFileSizeBase is 64MB.

Before the change

if (storeConfig.containsKey(ROCKSDB_COMPACTION_TARGET_FILE_SIZE_BASE)) {
options.setTargetFileSizeBase(storeConfig.getLong(ROCKSDB_COMPACTION_TARGET_FILE_SIZE_BASE));
}
if (storeConfig.containsKey(ROCKSDB_COMPACTION_TARGET_FILE_SIZE_MULTIPLIER)) {
options.setTargetFileSizeBase(storeConfig.getLong(ROCKSDB_COMPACTION_TARGET_FILE_SIZE_MULTIPLIER));
}

Behavior:

  • If ROCKSDB_COMPACTION_TARGET_FILE_SIZE_BASE is configured, the value of ROCKSDB_COMPACTION_TARGET_FILE_SIZE_BASE will be set as the target file size base.
  • If ROCKSDB_COMPACTION_TARGET_FILE_SIZE_MULTIPLIER is configured, the value of ROCKSDB_COMPACTION_TARGET_FILE_SIZE_MULTIPLIER will be set as the target file size base (it's wrong, and the file size multiplier should be set instead).

After the change

Behavior:

  • If ROCKSDB_COMPACTION_TARGET_FILE_SIZE_BASE is configured, the value of ROCKSDB_COMPACTION_TARGET_FILE_SIZE_BASE will be set as the target file size base.
  • If ROCKSDB_COMPACTION_TARGET_FILE_SIZE_MULTIPLIER is configured, the value of ROCKSDB_COMPACTION_TARGET_FILE_SIZE_MULTIPLIER will be set as the file size multiplier.

Tests

  • Run ./gradlew build

@ajothomas
Copy link
Contributor

Thanks for the fix.

@ajothomas ajothomas merged commit 17e552c into apache:master Aug 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants