From 243dc2efce99ab0faeba22fe12dcf28a7edc2ed8 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Tue, 22 Nov 2022 12:28:56 +0200 Subject: [PATCH] hints: host_filter: check topology::has_endpoint if enabled_selectively Don't call get_datacenter(ep) without checking first has_endpoint(ep) since the former may abort on internal error if the endpoint is not listed in topology. Refs #11870 Signed-off-by: Benny Halevy Closes #12054 --- db/hints/host_filter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/hints/host_filter.cc b/db/hints/host_filter.cc index 2bbdaa438b..2f6eaac2ce 100644 --- a/db/hints/host_filter.cc +++ b/db/hints/host_filter.cc @@ -33,7 +33,7 @@ bool host_filter::can_hint_for(const locator::topology& topo, gms::inet_address case enabled_kind::enabled_for_all: return true; case enabled_kind::enabled_selectively: - return _dcs.contains(topo.get_datacenter(ep)); + return topo.has_endpoint(ep, locator::topology::pending::yes) && _dcs.contains(topo.get_datacenter(ep)); case enabled_kind::disabled_for_all: return false; }