]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Avoid counting extra range tombstone compensated size in `AddRangeDels()` (#11091)
authorChangyu Bi <changyubi@meta.com>
Tue, 17 Jan 2023 20:47:44 +0000 (12:47 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 17 Jan 2023 20:47:44 +0000 (12:47 -0800)
commit6a82b68788d0fcf2b7a720edde7e443b71a93d78
treeb1e259cfc5eba7aa0421c4cd40598d1fb322f745
parentf515d9d2032e8aced7d92ec7bdb5aecd8585479a
Avoid counting extra range tombstone compensated size in `AddRangeDels()` (#11091)

Summary:
in `CompactionOutputs::AddRangeDels()`, range tombstones with the same start and end key but different sequence numbers all contribute to compensated range tombstone size. This PR removes this redundancy. This PR also includes a fix from https://github.com/facebook/rocksdb/issues/11067 where a range tombstone that is not within a file's range was being added to the file. This fixes an assertion failure for `icmp.Compare(start, end) <= 0` in VersionSet::ApproximateSize() when calculating compensated range tombstone size. Assertions and a comment/essay was added to reason that no such range tombstone will be added after this fix.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11091

Test Plan:
- Added unit tests
- Stress test with small key range: `python3 tools/db_crashtest.py blackbox --simple --max_key=100 --interval=600 --write_buffer_size=262144 --target_file_size_base=256 --max_bytes_for_level_base=262144 --block_size=128 --value_size_mult=33 --subcompactions=10`

Reviewed By: ajkr

Differential Revision: D42521588

Pulled By: cbi42

fbshipit-source-id: 5bda3fe38997995314e1f7592319af12b69bc4f8
db/builder.cc
db/compaction/compaction_outputs.cc
db/db_range_del_test.cc
db/version_edit.h