From a28239652fa1a8b2884cd0b0b0540c1de42f002d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przytu=C5=82a?= Date: Mon, 29 Jul 2024 17:18:54 +0200 Subject: [PATCH] topology: skip invalid peers instead of failing It appears that in some clusters there sometimes emerges a transient state that there are some incomplete/invalid peer entries in system tables. Under such circumstances, the driver would throw an error and fail the metadata refresh altogether, eventually leading to critical conditions such as no hosts to query. To fix this in line with how other drivers approach this, a warning is emitted upon invalid peer entry read, and the entry is skipped with no error returned. --- scylla/src/transport/topology.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scylla/src/transport/topology.rs b/scylla/src/transport/topology.rs index b468050c0b..fafa8afdca 100644 --- a/scylla/src/transport/topology.rs +++ b/scylla/src/transport/topology.rs @@ -819,10 +819,16 @@ async fn query_peers(conn: &Arc, connect_port: u16) -> Result create_peer_from_row(source, row, local_address).await, + Err(err) => { + warn!( + "system.peers or system.local has an invalid row, skipping it: {}", + err + ); + Ok(None) + } + } }); let peers = translated_peers_futures