From cc273ab2d11c23677359e443c663e1c2c8015740 Mon Sep 17 00:00:00 2001 From: Oliver Newland Date: Fri, 17 Dec 2021 11:05:48 -0800 Subject: [PATCH] validate by node list --- snuba/admin/clickhouse/system_queries.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snuba/admin/clickhouse/system_queries.py b/snuba/admin/clickhouse/system_queries.py index 823f2098ec..4b5b6ca707 100644 --- a/snuba/admin/clickhouse/system_queries.py +++ b/snuba/admin/clickhouse/system_queries.py @@ -94,8 +94,8 @@ class ActivePartitions(SystemQuery): def _is_valid_node(host: str, port: int, cluster: ClickhouseCluster) -> bool: - connection_id = cluster.get_connection_id() - return host == connection_id.hostname and port == connection_id.tcp_port + nodes = cluster.get_local_nodes() + return any(node.host_name == host and node.port == port for node in nodes) def run_system_query_on_host_by_name(