From cd1003daadc98d4dad6c2cd6ead4ddabedd98c18 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 1 Aug 2021 14:35:21 +0300 Subject: [PATCH] db: schema_tables: coroutinize read_table_names_of_keyspace() --- 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 548f2ae3f4..a3cb78d25b 100644 --- a/db/schema_tables.cc +++ b/db/schema_tables.cc @@ -936,12 +936,13 @@ future<> recalculate_schema_version(distributed& proxy, future> static read_table_names_of_keyspace(distributed& proxy, const sstring& keyspace_name, schema_ptr schema_table) { auto pkey = dht::decorate_key(*schema_table, partition_key::from_singular(*schema_table, keyspace_name)); - return db::system_keyspace::query(proxy, schema_table->ks_name(), schema_table->cf_name(), pkey).then([schema_table] (auto&& rs) { - return boost::copy_range>(rs->rows() | boost::adaptors::transformed([schema_table] (const query::result_set_row& row) { + auto&& rs = co_await db::system_keyspace::query(proxy, schema_table->ks_name(), schema_table->cf_name(), pkey); + { + co_return boost::copy_range>(rs->rows() | boost::adaptors::transformed([schema_table] (const query::result_set_row& row) { const sstring name = schema_table->clustering_key_columns().begin()->name_as_text(); return row.get_nonnull(name); })); - }); + } } static utils::UUID table_id_from_mutations(const schema_mutations& sm) {