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 <penberg@cloudius-systems.com>
This commit is contained in:
Pekka Enberg
2015-09-10 09:15:39 +03:00
parent fd9336afa6
commit 1f7fa18970

View File

@@ -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<std::set<sstring>>(dropped);