From 53120c1d57851a76bfe47ca02dfd035684eb6eb9 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Thu, 10 Aug 2023 14:34:32 +0300 Subject: [PATCH] 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. --- db/system_keyspace.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/system_keyspace.cc b/db/system_keyspace.cc index 73d0a6b4f7..195301c615 100644 --- a/db/system_keyspace.cc +++ b/db/system_keyspace.cc @@ -2607,8 +2607,9 @@ future system_keyspace::load_topology_state() { ret.tstate = service::transition_state_from_string(some_row.get_as("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"