From b0444083dbd2d68c5393b1710f928e2772da6708 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Wed, 3 Aug 2022 14:42:36 +0200 Subject: [PATCH] topology: use rpc_address instead of peer when fetching addrs When fetching node addresses from system tables, `peer` column is not the right choice - the address available for clients is generally stored in `rpc_address` column. Technically, a full solution should also fetch `broadcast_rpc_address` and use it if `rpc_address` is incorrect or set to 0.0.0.0, but this quick fix is enough to work for most configurations. --- scylla/src/transport/topology.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scylla/src/transport/topology.rs b/scylla/src/transport/topology.rs index 592e83f676..d53fd9c266 100644 --- a/scylla/src/transport/topology.rs +++ b/scylla/src/transport/topology.rs @@ -373,7 +373,8 @@ async fn query_metadata( } async fn query_peers(conn: &Connection, connect_port: u16) -> Result, QueryError> { - let mut peers_query = Query::new("select peer, data_center, rack, tokens from system.peers"); + let mut peers_query = + Query::new("select rpc_address, data_center, rack, tokens from system.peers"); peers_query.set_page_size(1024); let peers_query_future = conn.query_all(&peers_query, &[]);