system_keyspace::update_peer_info: check ep and host_id are not empty

This commit is contained in:
Petr Gusev
2024-02-09 14:51:45 +04:00
parent 86410d71d1
commit 2bf75c1a4e

View File

@@ -1874,6 +1874,12 @@ static data_value_or_unset make_data_value_or_unset(const std::optional<std::uno
}
future<> system_keyspace::update_peer_info(gms::inet_address ep, locator::host_id hid, const peer_info& info) {
if (ep == gms::inet_address{}) {
on_internal_error(slogger, format("update_peer_info called with empty inet_address, host_id {}", hid));
}
if (!hid) {
on_internal_error(slogger, format("update_peer_info called with empty host_id, ep {}", ep));
}
if (_db.get_token_metadata().get_topology().is_me(ep)) {
on_internal_error(slogger, format("update_peer_info called for this node: {}", ep));
}