diff --git a/service/storage_service.cc b/service/storage_service.cc index 53c392d1f3..2b2abbdaec 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -559,22 +559,21 @@ future storage_service::sync_raft_t on_fatal_internal_error(rtlogger, ::format("Cannot map id of a node being replaced {} to its ip", replaced_id)); } assert(existing_ip); + if (rs.ring.has_value()) { const auto replaced_host_id = locator::host_id(replaced_id.uuid()); tmptr->update_topology(replaced_host_id, std::nullopt, locator::node::state::being_replaced); update_topology(host_id, ip, rs); tmptr->add_replacing_endpoint(replaced_host_id, host_id); - if (t.tstate != service::topology::transition_state::join_group0) { - co_await update_topology_change_info(tmptr, ::format("replacing {}/{} by {}/{}", replaced_id, *existing_ip, id, ip)); + co_await update_topology_change_info(tmptr, ::format("replacing {}/{} by {}/{}", replaced_id, *existing_ip, id, ip)); } else { - // Do not update pending ranges in join_group0 state yet. After adding replacing endpoint above the - // node will no longer be reported for reads and writes, but it needs to be marked as alive - // before it is reported as pending. Otherwise increased CL during bootstrap will not be satisfied - // (replaced node cannot be contacted and replacing is reported as dead). So instead mark the node - // as UP (the node started report itself as alive already by this point). If it is down it will be - // marked as such eventually. - if (existing_ip == ip && !_gossiper.is_alive(*existing_ip)) { - co_await _gossiper.real_mark_alive(*existing_ip); - } + // After adding replacing endpoint above the node will no longer be reported for reads and writes, + // but it needs to be marked as alive before it is reported as pending. Otherwise increased CL + // during bootstrap will not be satisfied (replaced node cannot be contacted and replacing is reported + // as dead). So instead mark the node as UP (the node started report itself as alive already by this + // point). If it is down it will be marked as such eventually. + if (existing_ip == ip && !_gossiper.is_alive(*existing_ip)) { + co_await _gossiper.real_mark_alive(*existing_ip); + } } } break; diff --git a/test/topology_custom/test_replace_with_encryption.py b/test/topology_custom/test_replace_with_encryption.py index bc64e48d42..ea9e8db01c 100644 --- a/test/topology_custom/test_replace_with_encryption.py +++ b/test/topology_custom/test_replace_with_encryption.py @@ -8,7 +8,6 @@ from test.pylib.manager_client import ManagerClient from test.pylib.scylla_cluster import ReplaceConfig @pytest.mark.asyncio -@pytest.mark.xfail(reason="issue #19025") async def test_replace_with_encryption(manager: ManagerClient): """Test that a node can be replaced if inter-dc encryption is enabled. The test creates 6 node cluster with two DCs and replaces one node in