mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
alternator: correct catch table-already-exists exception
Our CreateTable handler assumed that the function migration_manager::announce_new_column_family() returns a failed future if the table already exists. But in some of our code branches, this is not the case - the function itself throws instead of returning a failed future. The solution is to use seastar::futurize_apply() to handle both possibilities (direct exception or future holding an exception). This fixes a failure of the test_table.py::test_create_table_already_exists test case. Signed-off-by: Nadav Har'El <nyh@scylladb.com>
This commit is contained in:
@@ -252,7 +252,7 @@ future<json::json_return_type> executor::create_table(std::string content) {
|
||||
|
||||
schema_ptr schema = builder.build();
|
||||
|
||||
return _mm.announce_new_column_family(schema, false).then([table_info = std::move(table_info), schema] () mutable {
|
||||
return futurize_apply([&] { return _mm.announce_new_column_family(schema, false); }).then([table_info = std::move(table_info), schema] () mutable {
|
||||
Json::Value status(Json::objectValue);
|
||||
supplement_table_info(table_info, *schema);
|
||||
status["TableDescription"] = std::move(table_info);
|
||||
|
||||
Reference in New Issue
Block a user