Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Dec 10, 2024
1 parent 026327f commit 3a2e98c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 25 deletions.
17 changes: 8 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inherits = "release"
debug = true

[workspace.dependencies]
scylla = { version = "0.14.0", features = ["ssl"] }
scylla = { version = "0.15.0", features = ["ssl"], git = "https://github.com/rukai/scylla-rust-driver", branch = "make_connection_setup_request_error_public" }
bytes = { version = "1.0.0", features = ["serde"] }
tokio = { version = "1.25.0", features = ["full"] }
tokio-util = { version = "0.7.7", features = ["codec"] }
Expand Down
14 changes: 12 additions & 2 deletions shotover-proxy/tests/cassandra_int_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ use futures::Future;
use pretty_assertions::assert_eq;
use rstest::rstest;
use rstest_reuse::{self, *};
use scylla::transport::errors::{
ConnectionError, ConnectionPoolError, ConnectionSetupRequestError,
ConnectionSetupRequestErrorKind, DbError, NewSessionError,
};
use scylla::SessionBuilder;
use std::net::SocketAddr;
#[cfg(feature = "cassandra-cpp-driver-tests")]
Expand Down Expand Up @@ -141,10 +145,16 @@ async fn passthrough_cassandra_down() {
.await
.unwrap_err();
match err {
scylla::transport::errors::NewSessionError::IoError(err) => {
NewSessionError::ConnectionPoolError(ConnectionPoolError::Broken {
last_connection_error:
ConnectionError::ConnectionSetupRequestError(ConnectionSetupRequestError {
error: ConnectionSetupRequestErrorKind::DbError(DbError::ServerError, err),
..
}),
}) => {
assert_eq!(
format!("{err}"),
format!("No connections in the pool; last connection failed with: Database returned an error: Internal server error. This indicates a server-side bug, Error message: Internal shotover (or custom transform) bug: Chain failed to send and/or receive messages, the connection will now be closed.
format!("Internal shotover (or custom transform) bug: Chain failed to send and/or receive messages, the connection will now be closed.
Caused by:
0: CassandraSinkSingle transform failed
Expand Down
35 changes: 22 additions & 13 deletions test-helpers/src/connection/cassandra/connection/scylla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use super::{Compression, Consistency, PreparedQuery, ProtocolVersion, Tls};
use crate::connection::cassandra::ResultValue;
use cdrs_tokio::frame::message_error::{ErrorBody, ErrorType};
use scylla::batch::Batch;
use scylla::frame::response::result::Row;
use scylla::frame::types::Consistency as ScyllaConsistency;
use scylla::frame::value::{CqlDate, CqlDecimal, CqlTime, CqlTimestamp};
use scylla::serialize::value::SerializeValue;
Expand Down Expand Up @@ -79,7 +80,7 @@ impl ScyllaConnection {
.execute_unpaged(statement, values)
.await
.unwrap();
let tracing_id = response.tracing_id.unwrap();
let tracing_id = response.tracing_id().unwrap();

tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
self.session
Expand Down Expand Up @@ -145,18 +146,26 @@ impl ScyllaConnection {
response: Result<QueryResult, QueryError>,
) -> Result<Vec<Vec<ResultValue>>, ErrorBody> {
match response {
Ok(value) => Ok(match value.rows {
Some(rows) => rows
.into_iter()
.map(|x| {
x.columns
.into_iter()
.map(ResultValue::new_from_scylla)
.collect()
})
.collect(),
None => vec![],
}),
Ok(value) => {
if value.is_rows() {
Ok(value
.into_rows_result()
.unwrap()
.rows::<Row>()
.unwrap()
.map(|x| {
x.unwrap()
.columns
.into_iter()
.map(ResultValue::new_from_scylla)
.collect()
})
.collect())
} else {
value.result_not_rows().unwrap();
Ok(vec![])
}
}
Err(QueryError::DbError(code, message)) => Err(ErrorBody {
ty: match code {
DbError::Overloaded => ErrorType::Overloaded,
Expand Down

0 comments on commit 3a2e98c

Please sign in to comment.