Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topology: skip invalid peers instead of failing #1045

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really would like to see #1021 here. IIUC this would most always return system.peers or system.local has invalid column type, no?

Either way, this LGTM as it addresses the skip part.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warn! prints a pretty message contained by err, so we should get the deepest possible explanation of what went wrong.

);
Ok(None)
}
}
});

let peers = translated_peers_futures
Expand Down
Loading