From 1f7fa18970fa24e2706be83097f14b1b0a6741f1 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Thu, 10 Sep 2015 09:15:39 +0300 Subject: [PATCH] db/schema_tables: Fix create keyspace notification We need to send out the notification for all created keyspaces, not just for the first one. Spotted during code inspection. Signed-off-by: Pekka Enberg --- db/schema_tables.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/db/schema_tables.cc b/db/schema_tables.cc index ea47cde09a..642485b290 100644 --- a/db/schema_tables.cc +++ b/db/schema_tables.cc @@ -623,12 +623,13 @@ future<> save_system_keyspace_schema() { // FIXME: clean this up by reorganizing the code // Send CQL events only once, not once per shard. if (engine().cpu_id() == 0) { - for (auto&& partition : created) { + return do_for_each(created, [] (auto&& partition) { auto ksm = create_keyspace_from_schema_partition(partition); return service::migration_manager::notify_create_keyspace(ksm); - } + }); + } else { + return make_ready_future<>(); } - return make_ready_future<>(); }); }).then([dropped = std::move(dropped)] () { return make_ready_future>(dropped);