tonbo-io / tonbo

A portable embedded database using Arrow.
https://tonbo.io
Apache License 2.0
606 stars 42 forks source link

Perf: `check_then_compaction` write lock optimization #137

Closed KKould closed 6 days ago

KKould commented 1 week ago

Feature Request

https://github.com/tonbo-io/tonbo/blob/main/src/compaction/mod.rs#L64 the write lock in Compactor::check_then_compaction waits for the data to be completely flushed to the disk before removing the immutables, causing the write lock to be held for a long time. A lock-free queue should be used to solve this problem.