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 <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2022-07-26 21:56:06 +03:00
parent 39276cacc3
commit 84dfd2cabb

View File

@@ -1391,9 +1391,6 @@ table::seal_snapshot(sstring jsondir, std::vector<snapshot_file_set> 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);