From 2d57dc32a3f985ef63fa890728a2a0472e5b8f3f Mon Sep 17 00:00:00 2001 From: Emil Maskovsky Date: Mon, 15 Sep 2025 11:39:10 +0200 Subject: [PATCH] topology_coordinator: consistently rethrow `raft::request_aborted` for direct/global commands Ensure all direct and global topology commands rethrow the `raft::request_aborted` exception when aborted, typically due to leadership changes. This makes abortion explicit to callers, enabling proper handling such as retries or workflow termination. This change completes the work started in PR scylladb/scylladb#23962, covering all remaining cases where the exception was not rethrown. Fixes: scylladb/scylladb#23589 (cherry picked from commit 943af1ef1ccb1c860e11e97cefc8250f6f1d3a05) --- service/topology_coordinator.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/service/topology_coordinator.cc b/service/topology_coordinator.cc index 20717784e8..81694f6303 100644 --- a/service/topology_coordinator.cc +++ b/service/topology_coordinator.cc @@ -2552,6 +2552,8 @@ class topology_coordinator : public endpoint_lifecycle_subscriber { node.guard = co_await exec_global_command(std::move(node.guard),raft_topology_cmd::command::barrier_and_drain, get_excluded_nodes(node), drop_guard_and_retake::yes); } catch (term_changed_error&) { throw; + } catch (raft::request_aborted&) { + throw; } catch(...) { rtlogger.warn("failed to run barrier_and_drain during rollback of {} after {} failure: {}", node.id, state, std::current_exception()); @@ -2629,6 +2631,8 @@ class topology_coordinator : public endpoint_lifecycle_subscriber { } } catch (term_changed_error&) { throw; + } catch (raft::request_aborted&) { + throw; } catch(...) { wait_for_ip_error = std::current_exception(); rtlogger.warn("raft_topology_cmd::command::wait_for_ip failed, error {}", @@ -2751,6 +2755,8 @@ class topology_coordinator : public endpoint_lifecycle_subscriber { rtbuilder.done(); } catch (term_changed_error&) { throw; + } catch (raft::request_aborted&) { + throw; } catch (...) { rtlogger.error("send_raft_topology_cmd(stream_ranges) failed with exception" " (node state is rebuilding): {}", std::current_exception());