Expand description
Sled compaction scheduling with lock-free atomics.
CompactionScheduler tracks write activity and decides when to trigger a
Sled WAL flush / compaction. All state is held in atomics so the scheduler
is cheaply shareable across threads without any mutex.
§Decision logic
A compaction is recommended when any of the following hold and no compaction is already in progress:
- The store has been idle for at least
CompactionConfig::idle_thresholdand at leastCompactionConfig::min_intervalhas elapsed since the last compaction. - Bytes written since the last compaction exceed
CompactionConfig::max_bytes_since_compact.
Structs§
- Compaction
Config - Configuration for automatic Sled compaction scheduling.
- Compaction
Scheduler - Lock-free compaction scheduler for Sled block stores.