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

Update scylla-rust-driver #1840

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
22 changes: 12 additions & 10 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"] }
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
Loading