mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-02 21:17:01 +00:00
replica: coroutinize table::discard_sstables()
Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
This commit is contained in:
@@ -1681,22 +1681,20 @@ future<db::replay_position> table::discard_sstables(db_clock::time_point truncat
|
||||
cf.refresh_compound_sstable_set();
|
||||
}
|
||||
};
|
||||
auto p = make_lw_shared<pruner>(*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<pruner>(*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<db::replay_position>(p->rp);
|
||||
});
|
||||
});
|
||||
co_return p->rp;
|
||||
}
|
||||
|
||||
void table::set_schema(schema_ptr s) {
|
||||
|
||||
Reference in New Issue
Block a user