Compaction blocked.
- Dominant language
- C++
- Stars
- 32.1k
- Forks
- 6.9k
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Description
When we write a DB with high concurrency, we find that L0 accumulates a lot of files, which leads to the occurrence of write stall or even write stop. Through the relevant logs and codes, we found that there will be multiple jobs that merge L0 files concurrently, instead of L0->L1 compaction([hit this](https://github.com/facebook/rocksdb/blob/main/db/compaction/compaction_picker_level.cc#L558)), because the flush speed is faster than the speed of L0 merge, which leads to L0's sst files accumulate quickly.
### Expected behavior
Faster L0->L1 compaction, write stops or write stalls are resolved eventually.
Or is it possible to turn off the L0->L0 behavior, we do not need to provide high-performance random reads, and can accept that there are multiple files in the L0 layer at certain times.
### Actual behavior
Since there is always a merge between L0 (L0->L0), the compaction of L0->L1 is not performed. Even if the files in the L0 layer have far exceeded level0_file_num_compaction_trigger.
### Steps to reproduce the behavior
Write some data with high concurrency.
Contributor guide
Assessment
This issue has not been assessed yet.