diff --git a/db/schema_tables.cc b/db/schema_tables.cc index dd6a6832ce..a0ef52596d 100644 --- a/db/schema_tables.cc +++ b/db/schema_tables.cc @@ -1657,17 +1657,13 @@ future> make_drop_table_mutations(lw_shared_ptr read_table_mutations(distributed& proxy, const qualified_name& table, schema_ptr s) { - return read_schema_partition_for_table(proxy, s, table.keyspace_name, table.table_name) - .then([&proxy, table] (mutation cf_m) { - return read_schema_partition_for_table(proxy, columns(), table.keyspace_name, table.table_name) - .then([&proxy, table, cf_m = std::move(cf_m)] (mutation col_m) { - return read_schema_partition_for_table(proxy, dropped_columns(), table.keyspace_name, table.table_name) - .then([&proxy, table, cf_m = std::move(cf_m), col_m = std::move(col_m)] (mutation dropped_m) { - return read_schema_partition_for_table(proxy, indexes(), table.keyspace_name, table.table_name) - .then([cf_m = std::move(cf_m), col_m = std::move(col_m), dropped_m = std::move(dropped_m)] (mutation idx_m) { - return schema_mutations{std::move(cf_m), std::move(col_m), std::move(idx_m), std::move(dropped_m)}; - }); - }); + return when_all_succeed( + read_schema_partition_for_table(proxy, s, table.keyspace_name, table.table_name), + read_schema_partition_for_table(proxy, columns(), table.keyspace_name, table.table_name), + read_schema_partition_for_table(proxy, dropped_columns(), table.keyspace_name, table.table_name), + read_schema_partition_for_table(proxy, indexes(), table.keyspace_name, table.table_name)).then( + [] (mutation cf_m, mutation col_m, mutation dropped_m, mutation idx_m) { + return schema_mutations{std::move(cf_m), std::move(col_m), std::move(idx_m), std::move(dropped_m)}; }); #if 0 // FIXME: @@ -1682,7 +1678,6 @@ static future read_table_mutations(distributed create_table_from_name(distributed& proxy, const sstring& keyspace, const sstring& table)