rocksdb/table
Changyu Bi 9f2363f4c4 User-defined timestamp support for `DeleteRange()` (#10661)
Summary:
Add user-defined timestamp support for range deletion. The new API is `DeleteRange(opt, cf, begin_key, end_key, ts)`. Most of the change is to update the comparator to compare without timestamp. Other than that, major changes are
- internal range tombstone data structures (`FragmentedRangeTombstoneList`, `RangeTombstone`, etc.) to store timestamps.
- Garbage collection of range tombstones and range tombstone covered keys during compaction.
- Get()/MultiGet() to return the timestamp of a range tombstone when needed.
- Get/Iterator with range tombstones bounded by readoptions.timestamp.
- timestamp crash test now issues DeleteRange by default.

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

Test Plan:
- Added unit test: `make check`
- Stress test: `python3 tools/db_crashtest.py --enable_ts whitebox --readpercent=57 --prefixpercent=4 --writepercent=25 -delpercent=5 --iterpercent=5 --delrangepercent=4`
- Ran `db_bench` to measure regression when timestamp is not enabled. The tests are for write (with some range deletion) and iterate with DB fitting in memory: `./db_bench--benchmarks=fillrandom,seekrandom --writes_per_range_tombstone=200 --max_write_buffer_number=100 --min_write_buffer_number_to_merge=100 --writes=500000 --reads=500000 --seek_nexts=10 --disable_auto_compactions -disable_wal=true --max_num_range_tombstones=1000`.  Did not see consistent regression in no timestamp case.

| micros/op | fillrandom | seekrandom |
| --- | --- | --- |
|main| 2.58 |10.96|
|PR 10661| 2.68 |10.63|

Reviewed By: riversand963

Differential Revision: D39441192

Pulled By: cbi42

fbshipit-source-id: f05aca3c41605caf110daf0ff405919f300ddec2
2022-09-30 16:13:03 -07:00
..
adaptive More refactoring ahead of footer & meta changes (#9240) 2021-12-10 08:13:26 -08:00
block_based User-defined timestamp support for `DeleteRange()` (#10661) 2022-09-30 16:13:03 -07:00
cuckoo Add support for wide-column point lookups (#10540) 2022-08-19 11:51:12 -07:00
plain Fix platform 10 build with folly (#10708) 2022-09-21 14:43:44 -07:00
block_fetcher.cc Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
block_fetcher.h Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
block_fetcher_test.cc Make MemoryAllocator into a Customizable class (#8980) 2021-12-17 04:20:47 -08:00
cleanable_test.cc Eliminate unnecessary (slow) block cache Ref()ing in MultiGet (#9899) 2022-04-26 21:59:24 -07:00
format.cc Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
format.h Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
get_context.cc User-defined timestamp support for `DeleteRange()` (#10661) 2022-09-30 16:13:03 -07:00
get_context.h User-defined timestamp support for `DeleteRange()` (#10661) 2022-09-30 16:13:03 -07:00
internal_iterator.h Skip swaths of range tombstone covered keys in merging iterator (2022 edition) (#10449) 2022-09-02 09:51:19 -07:00
iter_heap.h
iterator.cc Eliminate unnecessary (slow) block cache Ref()ing in MultiGet (#9899) 2022-04-26 21:59:24 -07:00
iterator_wrapper.h Skip swaths of range tombstone covered keys in merging iterator (2022 edition) (#10449) 2022-09-02 09:51:19 -07:00
merger_test.cc Cleanup multiple implementations of VectorIterator (#8901) 2021-10-06 07:48:31 -07:00
merging_iterator.cc User-defined timestamp support for `DeleteRange()` (#10661) 2022-09-30 16:13:03 -07:00
merging_iterator.h Fix memtable-only iterator regression (#10705) 2022-09-21 09:49:31 -07:00
meta_blocks.cc Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
meta_blocks.h Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
mock_table.cc Align compaction output file boundaries to the next level ones (#10655) 2022-09-29 19:43:55 -07:00
mock_table.h Align compaction output file boundaries to the next level ones (#10655) 2022-09-29 19:43:55 -07:00
multiget_context.h MultiGet async IO across multiple levels (#10535) 2022-08-19 16:52:52 -07:00
persistent_cache_helper.cc Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
persistent_cache_helper.h Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
persistent_cache_options.h Use STATIC_AVOID_DESTRUCTION for static objects with non-trivial destructors (#9958) 2022-05-17 09:39:22 -07:00
scoped_arena_iterator.h Remove code that only compiles for Visual Studio versions older than 2015 (#10065) 2022-05-26 16:55:08 -07:00
sst_file_dumper.cc Remove customized naming from InternalKeyComparator (#10343) 2022-07-12 13:30:35 -07:00
sst_file_dumper.h Support using ZDICT_finalizeDictionary to generate zstd dictionary (#9857) 2022-05-20 12:09:09 -07:00
sst_file_reader.cc User-defined timestamp support for `DeleteRange()` (#10661) 2022-09-30 16:13:03 -07:00
sst_file_reader_test.cc User-defined timestamp support for `DeleteRange()` (#10661) 2022-09-30 16:13:03 -07:00
sst_file_writer.cc User-defined timestamp support for `DeleteRange()` (#10661) 2022-09-30 16:13:03 -07:00
sst_file_writer_collectors.h Refactor to avoid confusing "raw block" (#10408) 2022-09-22 11:25:32 -07:00
table_builder.h Always verify SST unique IDs on SST file open (#10532) 2022-09-07 22:52:42 -07:00
table_factory.cc Restore Regex support for ObjectLibrary::Register, rename new APIs to allow old one to be deprecated in the future (#9362) 2022-01-11 06:33:48 -08:00
table_properties.cc Add seqno to time mapping (#10338) 2022-07-14 21:49:34 -07:00
table_properties_internal.h Improve / clean up meta block code & integrity (#9163) 2021-11-18 11:43:44 -08:00
table_reader.h Break TableReader MultiGet into filter and lookup stages (#10432) 2022-08-04 12:51:57 -07:00
table_reader_bench.cc Add support for wide-column point lookups (#10540) 2022-08-19 11:51:12 -07:00
table_reader_caller.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
table_test.cc Always verify SST unique IDs on SST file open (#10532) 2022-09-07 22:52:42 -07:00
two_level_iterator.cc Clarify caching behavior for index and filter partitions (#9068) 2021-10-27 17:23:04 -07:00
two_level_iterator.h
unique_id.cc Derive cache keys from SST unique IDs (#10394) 2022-08-12 13:49:49 -07:00
unique_id_impl.h Derive cache keys from SST unique IDs (#10394) 2022-08-12 13:49:49 -07:00