https://gitcode.net/kvdb/rocksdb/-/commit/6fd663a22f199656e3cec051c44d60672e87650eAvoid shifting component too large error in FileTtlBooster (#11673)2023-08-06T17:44:29-07:00Changyu Bichangyubi@meta.com
Summary:
When `num_levels` > 65, 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 large `num_levels`. I'll follow up with a more complex fix if needed.
Pull Request resolved: <a href="https://github.com/facebook/rocksdb/pull/11673" rel="nofollow noreferrer noopener" target="_blank">https://github.com/facebook/rocksdb/pull/11673</a>
Test Plan: * Add a unit test that produce the above error before this PR. Need to compile it with ubsan: `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`
Reviewed By: hx235
Differential Revision: D48074386
Pulled By: cbi42
fbshipit-source-id: 25e59df7e93f20e0793cffb941de70ac815d9392https://gitcode.net/kvdb/rocksdb/-/commit/89a3958bccdc9af519af8eda9270f4b51d1257b6include last bug fix into 8.5.02023-08-06T17:47:41-07:00Andrew Kryczkaandrew.kryczka2@gmail.com
* Fix use_after_free bug in async_io MultiReads when underlying FS enabled kFSBuffer. kFSBuffer is when underlying FS pass their own buffer instead of using RocksDB scratch in FSReadRequest. Right now it's an experimental feature.
* Fix a bug in FileTTLBooster that can cause users with a large number of levels (more than 65) to see errors like "runtime error: shift exponent .. is too large.." (#11673).