table: Use directory semaphore from sstables manager

It's natural for a table to itarate over its sstables, get the semaphore
from the manager of sstables, not from database.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2024-04-17 15:56:58 +03:00
parent 7e7dd2649b
commit be5bc38cde

View File

@@ -2305,7 +2305,7 @@ future<table::snapshot_file_set> table::take_snapshot(database& db, sstring json
auto table_names = std::make_unique<std::unordered_set<sstring>>();
co_await io_check([&jsondir] { return recursive_touch_directory(jsondir); });
co_await db.get_sharded_sst_dir_semaphore().local().parallel_for_each(tables, [&jsondir, &table_names] (sstables::shared_sstable sstable) {
co_await _sstables_manager.dir_semaphore().parallel_for_each(tables, [&jsondir, &table_names] (sstables::shared_sstable sstable) {
table_names->insert(sstable->component_basename(sstables::component_type::Data));
return io_check([sstable, &dir = jsondir] {
return sstable->snapshot(dir);