diff --git a/locator/topology.hh b/locator/topology.hh index 077dc6cff4..536cd7f9dc 100644 --- a/locator/topology.hh +++ b/locator/topology.hh @@ -171,6 +171,14 @@ public: // Returns a pointer to the node if found, or nullptr otherwise. const node* find_node(host_id id) const noexcept; + const node& get_node(host_id id) const { + auto n = find_node(id); + if (!n) { + throw_with_backtrace(format("Node {} not found in topology", id)); + } + return *n; + }; + // Looks up a node by its inet_address. // Returns a pointer to the node if found, or nullptr otherwise. const node* find_node(const inet_address& ep) const noexcept;