virtual seastar::future<std::vector<coll_core_t>> list_collections() = 0;
virtual seastar::future<std::string> get_default_device_class() = 0;
+
+ /// Run garbage collection on all shards until space ratios are acceptable.
+ /// Default implementation is a no-op (for stores that don't need GC).
+ virtual seastar::future<> do_gc() { return seastar::now(); }
protected:
const core_id_t primary_core;
};
});
}
+seastar::future<>
+ExtentPlacementManager::BackgroundProcess::run_cleaner_until_done()
+{
+ LOG_PREFIX(BackgroundProcess::run_cleaner_until_done);
+ ceph_assert(state == state_t::HALT);
+ assert(!is_running());
+ INFO("started...");
+ return seastar::do_until(
+ [this] {
+ return !main_cleaner->should_clean_space();
+ },
+ [this] {
+ return main_cleaner->clean_space(
+ ).handle_error(
+ crimson::ct_error::assert_all{
+ "run_cleaner_until_done encountered error in clean_space"
+ }
+ );
+ }
+ ).finally([FNAME] {
+ INFO("finished");
+ });
+}
+
seastar::future<>
ExtentPlacementManager::BackgroundProcess::reserve_projected_usage(
io_usage_t usage)
return background_process.run_until_halt();
}
+ seastar::future<> run_cleaner_until_done() {
+ return background_process.run_cleaner_until_done();
+ }
+
bool get_checksum_needed(paddr_t addr) {
// checksum offloading only for blocks physically stored in the device
#ifdef UNIT_TESTS_BUILT
}
seastar::future<> run_until_halt();
-
+ seastar::future<> run_cleaner_until_done();
+
bool is_no_background() const {
return !trimmer || !main_cleaner;
}
onode_manager.reset();
}
+seastar::future<> SeaStore::Shard::do_gc()
+{
+ LOG_PREFIX(SeaStore::Shard::do_gc);
+ if (!store_active || !transaction_manager) {
+ co_return;
+ }
+ auto *epm = transaction_manager->get_epm();
+ INFO("stopping background and running cleaner...");
+ co_await epm->stop_background();
+ co_await epm->run_cleaner_until_done();
+ INFO("done");
+}
+
+seastar::future<> SeaStore::do_gc()
+{
+ LOG_PREFIX(SeaStore::do_gc);
+ INFO("...");
+ co_await shard_stores.invoke_on_all([](auto &local_store) {
+ return seastar::do_for_each(local_store.mshard_stores, [](auto& mshard_store) {
+ return mshard_store->do_gc();
+ });
+ });
+ INFO("done");
+}
+
seastar::future<> SeaStore::write_fsid(uuid_d new_osd_fsid)
{
ceph_assert(seastar::this_shard_id() == primary_core);
// only exposed to SeaStore
public:
base_ertr::future<> umount();
+ seastar::future<> do_gc();
// init managers and mount transaction_manager
seastar::future<> mount_managers();
seastar::future<std::string> get_default_device_class() final;
+ seastar::future<> do_gc() override;
+
BackendStore get_backend_store(store_index_t store_index) override {
assert(!shard_stores.local().mshard_stores.empty());
if (store_index != NULL_STORE_INDEX) {