From 042e9252d5a1f50b7fb7d476b0420ccdd4db328d Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Mon, 28 Sep 2015 13:58:07 +0300 Subject: [PATCH] service/migration_manager: Implement announce_column_family_drop() Signed-off-by: Pekka Enberg --- service/migration_manager.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/service/migration_manager.cc b/service/migration_manager.cc index f63c157a6f..d2364d39ee 100644 --- a/service/migration_manager.cc +++ b/service/migration_manager.cc @@ -399,14 +399,11 @@ future<> migration_manager::announce_column_family_drop(const sstring& ks_name, { try { auto& db = get_local_storage_proxy().get_db().local(); - /*auto&& cfm = */db.find_schema(ks_name, cf_name); - /*auto&& ksm = */db.find_keyspace(ks_name); -#if 0 - logger.info(String.format("Drop table '%s/%s'", oldCfm.ksName, oldCfm.cfName)); - announce(LegacySchemaTables.makeDropTableMutation(ksm, oldCfm, FBUtilities.timestampMicros()), announceLocally); -#endif - // FIXME - throw std::runtime_error("not implemented"); + auto&& old_cfm = db.find_schema(ks_name, cf_name); + auto&& keyspace = db.find_keyspace(ks_name); + logger.info("Drop table '{}/{}'", old_cfm->ks_name(), old_cfm->cf_name()); + auto mutations = db::schema_tables::make_drop_table_mutations(keyspace.metadata(), old_cfm, db_clock::now_in_usecs()); + return announce(std::move(mutations), announce_locally); } catch (const no_such_column_family& e) { throw exceptions::configuration_exception(sprint("Cannot drop non existing table '%s' in keyspace '%s'.", cf_name, ks_name)); }