Skip to content

Commit

Permalink
Merge pull request scylladb#1045 from wprzytula/dont-fail-on-invalid-…
Browse files Browse the repository at this point in the history
…peer

topology: skip invalid peers instead of failing
  • Loading branch information
Lorak-mmk authored Aug 1, 2024
2 parents e0cdccb + a282396 commit a0e7856
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scylla/src/transport/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,10 +819,16 @@ async fn query_peers(conn: &Arc<Connection>, connect_port: u16) -> Result<Vec<Pe

let translated_peers_futures = untranslated_rows.map(|row_result| async {
let (source, raw_row) = row_result?;
let row = raw_row.into_typed().map_err(|_| {
QueryError::ProtocolError("system.peers or system.local has invalid column type")
})?;
create_peer_from_row(source, row, local_address).await
match raw_row.into_typed() {
Ok(row) => 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
Expand Down

0 comments on commit a0e7856

Please sign in to comment.