diff --git a/replica/table.cc b/replica/table.cc index d0b4e46f72..ad0d85fa2f 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -1681,22 +1681,20 @@ future table::discard_sstables(db_clock::time_point truncat cf.refresh_compound_sstable_set(); } }; - auto p = make_lw_shared(*this, *_compaction_group); - return _cache.invalidate(row_cache::external_updater([p, truncated_at] { - p->prune(truncated_at); - tlogger.debug("cleaning out row cache"); - })).then([this, p]() mutable { + // FIXME: indentation. + auto p = make_lw_shared(*this, *_compaction_group); + co_await _cache.invalidate(row_cache::external_updater([p, truncated_at] { + p->prune(truncated_at); + tlogger.debug("cleaning out row cache"); + })); rebuild_statistics(); - - return parallel_for_each(p->remove, [this, p] (pruner::removed_sstable& r) { + co_await coroutine::parallel_for_each(p->remove, [this, p] (pruner::removed_sstable& r) { if (r.enable_backlog_tracker) { remove_sstable_from_backlog_tracker(p->cg.get_backlog_tracker(), r.sst); } return sstables::sstable_directory::delete_atomically({r.sst}); - }).then([p] { - return make_ready_future(p->rp); }); - }); + co_return p->rp; } void table::set_schema(schema_ptr s) {