diff --git a/replica/table.cc b/replica/table.cc index 8daae7b9c9..91346c74f0 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -2305,13 +2305,11 @@ future table::take_snapshot(database& db, sstring json auto table_names = std::make_unique>(); co_await io_check([&jsondir] { return recursive_touch_directory(jsondir); }); - co_await max_concurrent_for_each(tables, db.get_sharded_sst_dir_semaphore().local()._concurrency, [&db, &jsondir, &table_names] (sstables::shared_sstable sstable) { + co_await db.get_sharded_sst_dir_semaphore().local().parallel_for_each(tables, [&jsondir, &table_names] (sstables::shared_sstable sstable) { table_names->insert(sstable->component_basename(sstables::component_type::Data)); - return with_semaphore(db.get_sharded_sst_dir_semaphore().local()._sem, 1, [&jsondir, sstable] { return io_check([sstable, &dir = jsondir] { return sstable->snapshot(dir); }); - }); }); co_await io_check(sync_directory, jsondir); co_return make_foreign(std::move(table_names)); diff --git a/sstables/sstable_directory.hh b/sstables/sstable_directory.hh index 8d62cc82ab..2b7490a33b 100644 --- a/sstables/sstable_directory.hh +++ b/sstables/sstable_directory.hh @@ -45,8 +45,6 @@ public: { } - friend class ::replica::table; // FIXME table snapshots should switch to sstable_directory - template requires std::is_invocable_r_v, Func, typename std::ranges::range_value_t&> future<> parallel_for_each(Container& c, Func func) {