diff --git a/compaction/compaction_manager.cc b/compaction/compaction_manager.cc index 6f40c3095e..2aac9951c1 100644 --- a/compaction/compaction_manager.cc +++ b/compaction/compaction_manager.cc @@ -486,6 +486,11 @@ void compaction_manager::postpone_compaction_for_column_family(column_family* cf } future<> compaction_manager::stop_tasks(std::vector> tasks, sstring reason) { + // To prevent compaction from being postponed while tasks are being stopped, let's set all + // tasks as stopping before the deferring point below. + for (auto& t : tasks) { + t->stopping = true; + } return do_with(std::move(tasks), [this, reason] (std::vector>& tasks) { return parallel_for_each(tasks, [this, reason] (auto& task) { return this->task_stop(task, reason).then_wrapped([](future <> f) {