diff --git a/alternator/executor.cc b/alternator/executor.cc index 07cd1d20c5..86b4282a0d 100644 --- a/alternator/executor.cc +++ b/alternator/executor.cc @@ -535,7 +535,7 @@ future executor::delete_table(client_state& clien } auto m = co_await mm.prepare_column_family_drop_announcement(keyspace_name, table_name, group0_guard.write_timestamp(), service::migration_manager::drop_views::yes); - auto m2 = mm.prepare_keyspace_drop_announcement(keyspace_name, group0_guard.write_timestamp()); + auto m2 = co_await mm.prepare_keyspace_drop_announcement(keyspace_name, group0_guard.write_timestamp()); std::move(m2.begin(), m2.end(), std::back_inserter(m)); diff --git a/cql3/statements/drop_keyspace_statement.cc b/cql3/statements/drop_keyspace_statement.cc index d8c59c4004..d727a9cd25 100644 --- a/cql3/statements/drop_keyspace_statement.cc +++ b/cql3/statements/drop_keyspace_statement.cc @@ -52,7 +52,7 @@ drop_keyspace_statement::prepare_schema_mutations(query_processor& qp, api::time ::shared_ptr ret; try { - m = qp.get_migration_manager().prepare_keyspace_drop_announcement(_keyspace, ts); + m = co_await qp.get_migration_manager().prepare_keyspace_drop_announcement(_keyspace, ts); using namespace cql_transport; ret = ::make_shared( diff --git a/service/migration_manager.cc b/service/migration_manager.cc index b43abe5083..c9d29b12f8 100644 --- a/service/migration_manager.cc +++ b/service/migration_manager.cc @@ -738,14 +738,15 @@ future> migration_manager::prepare_aggregate_drop_announce return include_keyspace(*keyspace.metadata(), std::move(mutations)); } -std::vector migration_manager::prepare_keyspace_drop_announcement(const sstring& ks_name, api::timestamp_type ts) { +future> migration_manager::prepare_keyspace_drop_announcement(const sstring& ks_name, api::timestamp_type ts) { auto& db = _storage_proxy.get_db().local(); if (!db.has_keyspace(ks_name)) { throw exceptions::configuration_exception(format("Cannot drop non existing keyspace '{}'.", ks_name)); } auto& keyspace = db.find_keyspace(ks_name); mlogger.info("Drop Keyspace '{}'", ks_name); - return db::schema_tables::make_drop_keyspace_mutations(db.features().cluster_schema_features(), keyspace.metadata(), ts); + auto mutations = db::schema_tables::make_drop_keyspace_mutations(db.features().cluster_schema_features(), keyspace.metadata(), ts); + return make_ready_future>(std::move(mutations)); } future> migration_manager::prepare_column_family_drop_announcement(const sstring& ks_name, diff --git a/service/migration_manager.hh b/service/migration_manager.hh index 91aa834e29..e1ac15c27b 100644 --- a/service/migration_manager.hh +++ b/service/migration_manager.hh @@ -134,7 +134,7 @@ public: future> prepare_update_type_announcement(user_type updated_type, api::timestamp_type); - std::vector prepare_keyspace_drop_announcement(const sstring& ks_name, api::timestamp_type); + future> prepare_keyspace_drop_announcement(const sstring& ks_name, api::timestamp_type); class drop_views_tag; using drop_views = bool_class; diff --git a/test/boost/schema_change_test.cc b/test/boost/schema_change_test.cc index 6e067f6546..1ee90a9bf4 100644 --- a/test/boost/schema_change_test.cc +++ b/test/boost/schema_change_test.cc @@ -477,7 +477,7 @@ SEASTAR_TEST_CASE(test_merging_creates_a_table_even_if_keyspace_was_recreated) { { auto group0_guard = mm.start_group0_operation().get(); const auto ts = group0_guard.write_timestamp(); - auto muts = e.migration_manager().local().prepare_keyspace_drop_announcement("ks", ts); + auto muts = e.migration_manager().local().prepare_keyspace_drop_announcement("ks", ts).get0(); boost::copy(muts, std::back_inserter(all_muts)); mm.announce(muts, std::move(group0_guard)).get(); } diff --git a/thrift/handler.cc b/thrift/handler.cc index d89830e2fb..d2e86b8fab 100644 --- a/thrift/handler.cc +++ b/thrift/handler.cc @@ -947,7 +947,7 @@ public: throw NotFoundException(); } - co_return mm.prepare_keyspace_drop_announcement(keyspace, ts); + co_return co_await mm.prepare_keyspace_drop_announcement(keyspace, ts); }); }); }