Sujeet
09/30/2025, 4:13 PMvalidate_compaction method to the scheduler's interface. This would serve as a dedicated hook for compaction schedulers to verify compaction scheduled by them.
Here are a couple of implementation ideas:
1. Provide a default implementation within the current compaction_scheduler trait. This would be easy to adopt and wouldn't require changes to existing compaction schedulers.
Rust
// Default implementation returns Ok
pub trait CompactionScheduler: Send + Sync {
fn maybe_schedule_compaction(&self, state: &CompactorState) -> Vec<Compaction>;
fn validate_compaction(...) -> Result<(), SlateDBError> { Ok(()) }
}
2. Use a separate CompactionValidator trait. This would cleanly separate the validation concern from scheduling logic.
Thoughts on the above☝️ . Curious to hear other perspectives.Rohan
09/30/2025, 4:24 PMCompactionScheduler trait. Validation is coupled pretty tightly to the scheduling logicSujeet
09/30/2025, 4:32 PMvalidate_compaction in compaction_state.rs method trait method implementation by size_tiered compaction. Does that seem fine?Sujeet
09/30/2025, 4:33 PMSujeet
09/30/2025, 6:06 PMvalidate_compaction boolean?Rohan
09/30/2025, 6:18 PMRohan
09/30/2025, 6:19 PMResult<(), String> so there can be some error msgSujeet
10/01/2025, 7:26 AMcriccomini
10/02/2025, 1:05 AMSujeet
10/02/2025, 1:38 AMSujeet
10/02/2025, 1:39 AMcriccomini
10/02/2025, 2:17 AM