Avoid shifting component too large error in FileTtlBooster #11673
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When
num_levels
> 64, we may be shifting more than 63 bits in FileTtlBooster. This can give errors like:runtime error: shift exponent 98 is too large for 64-bit type 'uint64_t' (aka 'unsigned long')
. This PR makes a quick fix for this issue by taking a min in the shifting component. This issue should be rare since it requires a user using a largenum_levels
. I'll follow up with a more complex fix if needed.Test plan:
COMPILE_WITH_UBSAN=1 OPT="-fsanitize-blacklist=.circleci/ubsan_suppression_list.txt" ROCKSDB_DISABLE_ALIGNED_NEW=1 USE_CLANG=1 make V=1 -j32 compaction_picker_test