topology_coordinator: suppress cancel warning in should_preempt_balancing

Agent-Logs-Url: https://github.com/scylladb/scylladb/sessions/ff8e4ba3-e470-4446-8a15-9f173b22c277

Co-authored-by: tgrabiec <283695+tgrabiec@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-10 19:25:21 +00:00
committed by GitHub
parent 7d648961ed
commit 39b6ff982c

View File

@@ -274,7 +274,7 @@ class topology_coordinator : public endpoint_lifecycle_subscriber
// cancel_requests - no request can be started so cancel the queue
// start_vnodes_cleanup - cleanup needs to be started
// node_to_work_on - the node the topology coordinator should work on
std::variant<group0_guard, cancel_requests, start_vnodes_cleanup, node_to_work_on> get_next_task(group0_guard guard) {
std::variant<group0_guard, cancel_requests, start_vnodes_cleanup, node_to_work_on> get_next_task(group0_guard guard, bool warn = true) {
auto& topo = _topo_sm._topology;
if (topo.transition_nodes.size() != 0) {
@@ -325,7 +325,9 @@ class topology_coordinator : public endpoint_lifecycle_subscriber
}
// We did not find a request that has enough live node to proceed
// Cancel all requests to let admin know that no operation can succeed
rtlogger.warn("topology coordinator: cancel request queue because no request can proceed. Dead nodes: {}", dead_nodes);
if (warn) {
rtlogger.warn("topology coordinator: cancel request queue because no request can proceed. Dead nodes: {}", dead_nodes);
}
return cancel_requests{std::move(guard), std::move(dead_nodes)};
}
@@ -2583,7 +2585,9 @@ class topology_coordinator : public endpoint_lifecycle_subscriber
// on the fact that the block which calls this is atomic.
// FIXME: Don't take the ownership of the guard to make the above guarantee explicit.
std::pair<bool, group0_guard> should_preempt_balancing(group0_guard guard) {
auto work = get_next_task(std::move(guard));
// Cancellation won't be acted upon here - it will be performed by handle_topology_transition()
// when called from the main loop. Suppress the warning to avoid duplicate messages.
auto work = get_next_task(std::move(guard), false /* warn */);
if (auto* node = std::get_if<node_to_work_on>(&work)) {
return std::make_pair(true, std::move(node->guard));
}