system_keyspace: fix assertion for missing transition_state

The code assumes that if there is no transition_state there should be no
nodes that currently in transition in a state other then left_token_ring
state, but rebuild operation also creates such nodes, so add the check
for it as well.
This commit is contained in:
Gleb Natapov
2023-08-10 14:34:32 +03:00
parent 59c410fb97
commit 53120c1d57

View File

@@ -2607,8 +2607,9 @@ future<service::topology> system_keyspace::load_topology_state() {
ret.tstate = service::transition_state_from_string(some_row.get_as<sstring>("transition_state"));
} else {
// Any remaining transition_nodes must be in left_token_ring state
// or rebuilding
auto it = std::find_if(ret.transition_nodes.begin(), ret.transition_nodes.end(),
[] (auto& p) { return p.second.state != service::node_state::left_token_ring; });
[] (auto& p) { return p.second.state != service::node_state::left_token_ring && p.second.state != service::node_state::rebuilding; });
if (it != ret.transition_nodes.end()) {
on_internal_error(slogger, format(
"load_topology_state: topology not in transition state"