mirror of
https://github.com/facebook/rocksdb.git
synced 2026-10-23 08:09:02 +03:00
Deprecate ReadOptions::ignore_range_deletions and experimental::PromoteL0() (#13500)
Summary: based on the option comment, `ignore_range_deletions` was added due to the overhead of range deletions in read path when a DB does not use DeleteRange(). The current implementation should not have a noticeable performance difference in this case. `experimental::PromoteL0()` can be replaced by doing a manual compaction with proper CompactRangeOptions. There are some internal use of these option and API so we will remove them later after the usages are updated. Pull Request resolved: https://github.com/facebook/rocksdb/pull/13500 Test Plan: comment change only. Performance: benchmark the performance difference with `ignore_range_deletions` and without (borrowed flag `universal_incremental` for this purpose), ran at the same time on the same machine. - random point get: - ignore_range_deletions=false: 343078 ops/sec - ignore_range_deletions=true: 340219 ops/sec (0.8% slower) ``` (for I in $(seq 1 1); do TEST_TMPDIR=/dev/shm/t1 /data/users/changyubi/vscode-root/rocksdb/db_bench --benchmarks=fillseq,waitforcompaction,readrandom --write_buffer_size=67108864 --writes=1000000 --num=2000000 --reads=1000000 --seed=1723056275 --universal_incremental=false 2>&1 | grep "readrandom"; done;) | awk '{ t += $5; c++; print } END { print 1.0 * t / c }'; ``` - sequential scan: - ignore_range_deletions=false: 5378104 ops/sec - ignore_range_deletions=true: 5393809 ops/sec (0.3% faster) ``` (for I in $(seq 1 10); do TEST_TMPDIR=/dev/shm/t1 /data/users/changyubi/vscode-root/rocksdb/db_bench --benchmarks=fillseq,waitforcompaction,readseq[-X10] --write_buffer_size=67108864 --writes=1000000 --num=2000000 --universal_incremental=true --seed=1723056275 2>1 | grep "\[AVG 10 runs\]"; done;) | awk '{ t += $6; c++; print; } END { printf "%.0f\n", 1.0 * t / c }'; ``` The difference in ops/sec for the two benchmarks is likely noise. Reviewed By: hx235 Differential Revision: D72069223 Pulled By: cbi42 fbshipit-source-id: ad82a051aa4682790d2178cd4fb2d1467397fbb5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
743a02d6f6
commit
325dcdf2e5
@@ -398,7 +398,10 @@ public class ReadOptions extends RocksObject {
|
||||
* Default: false
|
||||
*
|
||||
* @return true if keys deleted using the DeleteRange() API will be visible
|
||||
*
|
||||
* @deprecated This option may be remove in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean ignoreRangeDeletions() {
|
||||
assert(isOwningHandle());
|
||||
return ignoreRangeDeletions(nativeHandle_);
|
||||
@@ -414,7 +417,10 @@ public class ReadOptions extends RocksObject {
|
||||
* @param ignoreRangeDeletions true if keys deleted using the DeleteRange()
|
||||
* API should be visible
|
||||
* @return the reference to the current ReadOptions.
|
||||
*
|
||||
* @deprecated This option may be remove in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
public ReadOptions setIgnoreRangeDeletions(final boolean ignoreRangeDeletions) {
|
||||
assert(isOwningHandle());
|
||||
setIgnoreRangeDeletions(nativeHandle_, ignoreRangeDeletions);
|
||||
|
||||
@@ -4633,10 +4633,13 @@ public class RocksDB extends RocksObject {
|
||||
* @param targetLevel the target level for L0
|
||||
*
|
||||
* @throws RocksDBException if an error occurs whilst promoting L0
|
||||
*
|
||||
* @deprecated this API may be removed in a future release.
|
||||
*/
|
||||
@Deprecated
|
||||
public void promoteL0(
|
||||
/* @Nullable */final ColumnFamilyHandle columnFamilyHandle,
|
||||
final int targetLevel) throws RocksDBException {
|
||||
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle, final int targetLevel)
|
||||
throws RocksDBException {
|
||||
promoteL0(nativeHandle_,
|
||||
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
||||
targetLevel);
|
||||
@@ -4648,9 +4651,11 @@ public class RocksDB extends RocksObject {
|
||||
* @param targetLevel the target level for L0
|
||||
*
|
||||
* @throws RocksDBException if an error occurs whilst promoting L0
|
||||
*
|
||||
* @deprecated this API may be removed in a future release.
|
||||
*/
|
||||
public void promoteL0(final int targetLevel)
|
||||
throws RocksDBException {
|
||||
@Deprecated
|
||||
public void promoteL0(final int targetLevel) throws RocksDBException {
|
||||
promoteL0(null, targetLevel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user