Compaction I/O starves foreground reads

DesignHard45 minMeta style

Your task

An LSM store handles ingest fine most of the time, but during traffic bursts foreground reads/writes spike AND compaction has to run to keep the LSM shape healthy, and they fight over the same disk I/O. Symptoms: read p99 spikes during compaction, and occasionally writes STALL entirely because L0 files pile up faster than compaction drains them. Design the compaction scheduler / I/O controller that keeps the tree healthy without letting background compaction starve foreground latency, and explain the dilemma (why you can't just deprioritize compaction).

It covers

  • Compaction scheduling
  • Io prioritization
  • Write stall