rocksdb/db/compaction
Jay Zhuang 23fa5b7789 Use sstableKeyCompare() for compaction output boundary check (#10763)
Summary:
To make it consistent with the compaction picker which uses the `sstableKeyCompare()` to pick the overlap files. For example, without this change, it may cut L1 files like:
```
 L1: [2-21]  [22-30]
 L2: [1-10] [21-30]
```
Because "21" on L1 is smaller than "21" on L2. But for compaction, these 2 files are overlapped.
`sstableKeyCompare()` also take range delete into consideration which may cut file for the same key.
It also makes the `max_compaction_bytes` calculation more accurate for cases like above, the overlapped bytes was under estimated. Also make sure the 2 keys won't be splitted to 2 files because of reaching `max_compaction_bytes`.

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

Reviewed By: cbi42

Differential Revision: D39971904

Pulled By: cbi42

fbshipit-source-id: bcc309e9c3dc61a8f50667a6f633e6132c0154a8
2022-10-06 15:54:58 -07:00
..
clipping_iterator.h Make InternalKeyComparator not configurable (#10342) 2022-07-14 10:09:31 -07:00
clipping_iterator_test.cc Cleanup multiple implementations of VectorIterator (#8901) 2021-10-06 07:48:31 -07:00
compaction.cc Align compaction output file boundaries to the next level ones (#10655) 2022-09-29 19:43:55 -07:00
compaction.h Align compaction output file boundaries to the next level ones (#10655) 2022-09-29 19:43:55 -07:00
compaction_iteration_stats.h Support readahead during compaction for blob files (#9187) 2021-11-19 17:53:47 -08:00
compaction_iterator.cc User-defined timestamp support for DeleteRange() (#10661) 2022-09-30 16:13:03 -07:00
compaction_iterator.h Include minimal contextual information in CompactionIterator (#10505) 2022-08-09 17:07:24 -07:00
compaction_iterator_test.cc Tiered Compaction: per key placement support (#9964) 2022-07-13 20:54:49 -07:00
compaction_job.cc RoundRobin TTL compaction (#10725) 2022-10-04 14:53:32 -07:00
compaction_job.h Support subcmpct using reserved resources for round-robin priority (#10341) 2022-07-24 11:12:44 -07:00
compaction_job_stats_test.cc Remove own ToString() (#9955) 2022-05-06 13:03:58 -07:00
compaction_job_test.cc Use sstableKeyCompare() for compaction output boundary check (#10763) 2022-10-06 15:54:58 -07:00
compaction_outputs.cc Use sstableKeyCompare() for compaction output boundary check (#10763) 2022-10-06 15:54:58 -07:00
compaction_outputs.h Use sstableKeyCompare() for compaction output boundary check (#10763) 2022-10-06 15:54:58 -07:00
compaction_picker.cc Use actual file size when checking max_compaction_size (#10728) 2022-09-30 10:50:44 -07:00
compaction_picker.h Support subcmpct using reserved resources for round-robin priority (#10341) 2022-07-24 11:12:44 -07:00
compaction_picker_fifo.cc Fix underflow in FIFOCompactionPicker (#10386) 2022-07-22 09:20:35 -07:00
compaction_picker_fifo.h Add OpenAndTrimHistory API to support trimming data with specified timestamp (#9410) 2022-03-11 16:13:23 -08:00
compaction_picker_level.cc RoundRobin TTL compaction (#10725) 2022-10-04 14:53:32 -07:00
compaction_picker_level.h Make ImmutableOptions struct that inherits from ImmutableCFOptions and ImmutableDBOptions (#8262) 2021-05-05 14:00:17 -07:00
compaction_picker_test.cc Fix overlapping check by excluding timestamp (#10615) 2022-09-08 13:03:07 -07:00
compaction_picker_universal.cc Fix overlapping check by excluding timestamp (#10615) 2022-09-08 13:03:07 -07:00
compaction_picker_universal.h Make ImmutableOptions struct that inherits from ImmutableCFOptions and ImmutableDBOptions (#8262) 2021-05-05 14:00:17 -07:00
compaction_service_job.cc Improve SubCompaction Partitioning (#10393) 2022-07-23 17:38:49 -07:00
compaction_service_test.cc Deflake CompactionServiceTest.BasicCompactions (#10697) 2022-09-19 14:10:05 -07:00
compaction_state.cc Tiered Compaction: per key placement support (#9964) 2022-07-13 20:54:49 -07:00
compaction_state.h Tiered Compaction: per key placement support (#9964) 2022-07-13 20:54:49 -07:00
file_pri.h Try to start TTL earlier with kMinOverlappingRatio is used (#8749) 2021-11-01 14:36:31 -07:00
sst_partitioner.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
subcompaction_state.cc Refactor Compaction file cut ShouldStopBefore() (#10629) 2022-09-14 22:09:12 -07:00
subcompaction_state.h Refactor Compaction file cut ShouldStopBefore() (#10629) 2022-09-14 22:09:12 -07:00
tiered_compaction_test.cc Change bottommost_temperture to last_level_temperture (#10471) 2022-08-08 14:36:34 -07:00