From 25ae8a6376ee45be14e0ae1c196ed448558e2fd7 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Wed, 24 Nov 2021 10:53:39 +0200 Subject: [PATCH] migration_manager: add prepare_function_drop_announcement() function The function only generates mutations for the announcement, but does not send them out. Will be used by the later patches. --- service/migration_manager.cc | 9 ++++++--- service/migration_manager.hh | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/service/migration_manager.cc b/service/migration_manager.cc index 2106a0a20a..d89331705d 100644 --- a/service/migration_manager.cc +++ b/service/migration_manager.cc @@ -778,12 +778,15 @@ future<> migration_manager::announce_new_function(shared_ptr migration_manager::announce_function_drop( - shared_ptr func) { +future> migration_manager::prepare_function_drop_announcement(shared_ptr func) { auto& db = get_local_storage_proxy().get_db().local(); auto&& keyspace = db.find_keyspace(func->name().keyspace); auto mutations = db::schema_tables::make_drop_function_mutations(func, api::new_timestamp()); - return include_keyspace_and_announce(*keyspace.metadata(), std::move(mutations)); + return include_keyspace(*keyspace.metadata(), std::move(mutations)); +} + +future<> migration_manager::announce_function_drop(shared_ptr func) { + co_return co_await announce(co_await prepare_function_drop_announcement(std::move(func))); } future> migration_manager::prepare_new_aggregate_announcement(shared_ptr aggregate) { diff --git a/service/migration_manager.hh b/service/migration_manager.hh index 95be43d1d3..d276649e2a 100644 --- a/service/migration_manager.hh +++ b/service/migration_manager.hh @@ -156,6 +156,7 @@ public: future> prepare_new_aggregate_announcement(shared_ptr aggregate); future<> announce_function_drop(shared_ptr func); + future> prepare_function_drop_announcement(shared_ptr func); future<> announce_aggregate_drop(shared_ptr aggregate);