From 10c14cd044462af4687faac79256675c95cfcf72 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Wed, 24 Nov 2021 10:13:27 +0200 Subject: [PATCH] migration_manager: add prepare_new_function_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 | 8 ++++++-- service/migration_manager.hh | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/service/migration_manager.cc b/service/migration_manager.cc index 5de59a881c..0fbcad5bc4 100644 --- a/service/migration_manager.cc +++ b/service/migration_manager.cc @@ -767,11 +767,15 @@ future<> migration_manager::announce_type_update(user_type updated_type) { return do_announce_new_type(updated_type); } -future<> migration_manager::announce_new_function(shared_ptr func) { +future> migration_manager::prepare_new_function_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_create_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_new_function(shared_ptr func) { + co_return co_await announce(co_await prepare_new_function_announcement(std::move(func))); } future<> migration_manager::announce_function_drop( diff --git a/service/migration_manager.hh b/service/migration_manager.hh index c6ebd0e6a7..642579627b 100644 --- a/service/migration_manager.hh +++ b/service/migration_manager.hh @@ -150,6 +150,7 @@ public: future<> announce_new_type(user_type new_type); future<> announce_new_function(shared_ptr func); + future> prepare_new_function_announcement(shared_ptr func); future<> announce_new_aggregate(shared_ptr aggregate);