From 84dfd2cabbcc0918b27ab795baf5f13546aed9f9 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Tue, 26 Jul 2022 21:56:06 +0300 Subject: [PATCH] table: snapshot: move pending_snapshots.erase from seal_snapshot Now that seal_snapshot doesn't need to lookup the snapshot_manager in pending_snapshots to get to the file_sets, erasing the snapshot_manager object can be done in table::snapshot which also inserted it there. This will make it easier to get rid of it in a later patch. Signed-off-by: Benny Halevy --- replica/table.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/replica/table.cc b/replica/table.cc index b6a815578e..3cf15a87db 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -1391,9 +1391,6 @@ table::seal_snapshot(sstring jsondir, std::vector file_sets) }); }).then([jsondir] { return io_check(sync_directory, std::move(jsondir)); - }).finally([jsondir] { - pending_snapshots.erase(jsondir); - return make_ready_future<>(); }); } @@ -1511,6 +1508,7 @@ future<> table::snapshot(database& db, sstring name) { } catch (...) { ex = std::current_exception(); } + pending_snapshots.erase(jsondir); snapshot->manifest_write.signal(smp::count); } tlogger.debug("snapshot {}: waiting for manifest on behalf of shard {}", jsondir, requester);