From be5bc38cde1279ea68ed46426e6e4d97868627bc Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Wed, 17 Apr 2024 15:56:58 +0300 Subject: [PATCH] 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 --- replica/table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/replica/table.cc b/replica/table.cc index 100841628f..c611b52dcd 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -2305,7 +2305,7 @@ 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 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);