diff --git a/compaction/compaction_manager.cc b/compaction/compaction_manager.cc index 680c9f7984..38288f48a3 100644 --- a/compaction/compaction_manager.cc +++ b/compaction/compaction_manager.cc @@ -2290,8 +2290,12 @@ compaction_manager::maybe_split_new_sstable(sstables::shared_sstable sst, compac if (!split_compaction_task_executor::sstable_needs_split(sst, opt)) { co_return std::vector{sst}; } - if (!can_proceed(&t)) { - co_return std::vector{sst}; + // Throw an error if split cannot be performed due to e.g. out of space prevention. + // We don't want to prevent split because compaction is temporarily disabled on a view only for synchronization, + // which is uneeded against new sstables that aren't part of any set yet, so never use can_proceed(&t) here. + if (is_disabled()) { + co_return coroutine::exception(std::make_exception_ptr(std::runtime_error(format("Cannot split {} because manager has compaction disabled, " \ + "reason might be out of space prevention", sst->get_filename())))); } std::vector ret; diff --git a/compaction/compaction_manager.hh b/compaction/compaction_manager.hh index 935c5ec0d6..ada294d9da 100644 --- a/compaction/compaction_manager.hh +++ b/compaction/compaction_manager.hh @@ -376,6 +376,7 @@ public: // Splits a single SSTable by segregating all its data according to the classifier. // If SSTable doesn't need split, the same input SSTable is returned as output. // If SSTable needs split, then output SSTables are returned and the input SSTable is deleted. + // Exception is thrown if the input sstable cannot be split due to e.g. out of space prevention. future> maybe_split_new_sstable(sstables::shared_sstable sst, compaction_group_view& t, compaction_type_options::split opt); // Run a custom job for a given table, defined by a function