venice
venice copied to clipboard
[server] Feature to tune level0 compaction tuning for read-write leader
In the ingestion path, we often tune level0 compaction to optimize read/write/space optimization. When AA/WC is enabled, the leader replica will read the same database while ingesting, which is different from standby replicas. To optimize the read perf of leader replica, this PR exposes the following config: rocksdb.level0.compaction.tuning.for.read.write.leader.enabled: default false rocksdb.level0.file.num.compaction.trigger.for.read.write.leader: default 10 rocksdb.level0.slowdown.writes.trigger.for.read.write.leader: default 20 rocksdb.level0.stops.writes.trigger.for.read.write.leader: default 40
Essentially, there are 3 sets of level0 compaction tunings:
- Leader replicas for AA/WC stores.
- Future version.
- Current version.
The main reason we would like to only optimize the leader replica for AA/WC stores:
- Standby replicas don't read at ingestion path.
- Try to keep the write/space amplication factor for standby replicas as more aggressive level0 compaction tuning is expensive.
How was this PR tested?
CI
Does this PR introduce any user-facing changes?
- [x] No. You can skip the rest of this section.
- [ ] Yes. Make sure to explain your proposed changes and call out the behavior change.