diff --git a/scylla/src/transport/speculative_execution.rs b/scylla/src/transport/speculative_execution.rs index ecc9d02c78..ca7b1d0c71 100644 --- a/scylla/src/transport/speculative_execution.rs +++ b/scylla/src/transport/speculative_execution.rs @@ -85,10 +85,23 @@ impl SpeculativeExecutionPolicy for PercentileSpeculativeExecutionPolicy { fn can_be_ignored(result: &Result) -> bool { match result { Ok(_) => false, - Err(QueryError::BrokenConnection(_)) => true, - Err(QueryError::ConnectionPoolError(_)) => true, - Err(QueryError::TimeoutError) => true, - _ => false, + Err(e) => match e { + QueryError::BrokenConnection(_) + | QueryError::ConnectionPoolError(_) + | QueryError::TimeoutError => true, + + QueryError::DbError(_, _) + | QueryError::BadQuery(_) + | QueryError::CqlRequestSerialization(_) + | QueryError::BodyExtensionsParseError(_) + | QueryError::EmptyPlan + | QueryError::CqlResultParseError(_) + | QueryError::CqlErrorParseError(_) + | QueryError::MetadataError(_) + | QueryError::ProtocolError(_) + | QueryError::UnableToAllocStreamId + | QueryError::RequestTimeout(_) => false, + }, } }