Skip to content

Commit 8780f1b

Browse files
committed
Update deps
1 parent 6b0b6c0 commit 8780f1b

File tree

11 files changed

+1291
-1113
lines changed

11 files changed

+1291
-1113
lines changed

Cargo.lock

Lines changed: 1237 additions & 1082 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ inherits = "release"
2121
debug = true
2222

2323
[workspace.dependencies]
24-
scylla = { version = "1.0.0", features = ["openssl-010"] }
24+
# scylla 1.5.0 break our integration tests, requires further investigation.
25+
# issues relate to:
26+
# * routing to ports other than 9042 is broken for the await_schema_agreement session.
27+
# * out of rack routing checks?
28+
scylla = { version = "=1.4.0", features = ["openssl-010"] }
2529
bytes = { version = "1.11.1", features = ["serde"] }
2630
tokio = { version = "1.44.2", features = ["full"] }
2731
tokio-util = { version = "0.7.7", features = ["codec"] }
@@ -31,7 +35,7 @@ anyhow = "1.0.76"
3135
serde = { version = "1.0.111", features = ["derive"] }
3236
serde_yaml = "0.9.17"
3337
uuid = { version = "1.0.0", features = ["serde", "v4"] }
34-
reqwest = { version = "0.12.0", default-features = false, features = ["http2"] }
38+
reqwest = { version = "0.13.0", default-features = false, features = ["http2"] }
3539
redis = { version = "0.29.2", features = ["tokio-comp", "tokio-rustls-comp", "tls-rustls-insecure", "cluster"] }
3640
cdrs-tokio = "8.0"
3741
cassandra-protocol = "3.0"
@@ -41,8 +45,8 @@ tracing = { version = "0.1.15", features = ["release_max_level_debug"] }
4145
tracing-subscriber = { version = "0.3.1", features = ["env-filter", "json"] }
4246
tracing-appender = "0.2.0"
4347
serde_json = "1.0"
44-
rcgen = { version = "0.13.0", default-features = false, features = ["pem", "aws_lc_rs"] }
45-
subprocess = "0.2.7"
48+
rcgen = { version = "0.14.0", default-features = false, features = ["pem", "aws_lc_rs"] }
49+
subprocess = "1.0.0"
4650
chacha20poly1305 = { version = "0.10.0", features = ["std"] }
4751
csv = "1.2.0"
4852
redis-protocol = { version = "6.0.0", features = ["bytes"] }

ec2-cargo/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ tracing-subscriber.workspace = true
1414
aws-throwaway.workspace = true
1515
tracing-appender.workspace = true
1616
shellfish = { version = "0.10.0", features = ["async"] }
17-
cargo_metadata = "0.20.0"
17+
cargo_metadata = "0.23.0"
1818
shell-quote.workspace = true

shotover-proxy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ scylla.workspace = true
1717
anyhow.workspace = true
1818
tokio.workspace = true
1919
tracing.workspace = true
20-
rstest = "0.25.0"
20+
rstest = "0.26.0"
2121
rstest_reuse = "0.7.0"
2222
test-helpers = { path = "../test-helpers" }
2323
redis.workspace = true

shotover-proxy/benches/windsock/cassandra/bench.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub enum Operation {
113113
}
114114

115115
impl Operation {
116-
async fn prepare(&self, session: &Arc<CassandraSession>, db: &CassandraDb) {
116+
async fn prepare(&self, session: &CassandraSession, db: &CassandraDb) {
117117
if let CassandraDb::Cassandra = db {
118118
session.query("CREATE KEYSPACE IF NOT EXISTS ks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }").await;
119119
session.await_schema_agreement().await;
@@ -147,7 +147,7 @@ impl Operation {
147147

148148
async fn run(
149149
&self,
150-
session: &Arc<CassandraSession>,
150+
session: &CassandraSession,
151151
reporter: UnboundedSender<Report>,
152152
parameters: BenchParameters,
153153
) {
@@ -229,13 +229,16 @@ pub enum CassandraDriver {
229229
CdrsTokio,
230230
}
231231

232+
#[derive(Clone)]
232233
pub enum CassandraSession {
233-
Scylla(ScyllaSession),
234+
Scylla(Arc<ScyllaSession>),
234235
CdrsTokio(
235-
CdrsTokioSession<
236-
TransportTcp,
237-
TcpConnectionManager,
238-
RoundRobinLoadBalancingStrategy<TransportTcp, TcpConnectionManager>,
236+
Arc<
237+
CdrsTokioSession<
238+
TransportTcp,
239+
TcpConnectionManager,
240+
RoundRobinLoadBalancingStrategy<TransportTcp, TcpConnectionManager>,
241+
>,
239242
>,
240243
),
241244
}
@@ -691,7 +694,7 @@ impl Bench for CassandraBench {
691694
let address = resources;
692695

693696
let session = match (self.protocol, self.driver) {
694-
(CassandraProtocol::V4, CassandraDriver::Scylla) => Arc::new(CassandraSession::Scylla(
697+
(CassandraProtocol::V4, CassandraDriver::Scylla) => CassandraSession::Scylla(Arc::new(
695698
ScyllaSessionBuilder::new()
696699
.known_nodes([address])
697700
.user("cassandra", "cassandra")
@@ -723,7 +726,7 @@ impl Bench for CassandraBench {
723726
.build()
724727
.await
725728
.unwrap();
726-
Arc::new(CassandraSession::CdrsTokio(
729+
CassandraSession::CdrsTokio(Arc::new(
727730
TcpSessionBuilder::new(RoundRobinLoadBalancingStrategy::new(), cluster_config)
728731
.with_compression(match self.compression {
729732
Compression::None => CdrsCompression::None,
@@ -823,7 +826,7 @@ struct AwsNodeInfo {
823826

824827
#[derive(Clone)]
825828
struct BenchTaskCassandra {
826-
session: Arc<CassandraSession>,
829+
session: CassandraSession,
827830
query: PreparedStatement,
828831
operation: Operation,
829832
}

shotover-proxy/tests/runner/runner_int_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::shotover_process;
22
use test_helpers::shotover_process::{EventMatcher, Level};
33

44
#[tokio::test]
5+
#[cfg(feature = "cassandra")]
56
async fn test_early_shutdown_cassandra_source() {
67
shotover_process("tests/test-configs/null-cassandra/topology.yaml")
78
.start()
@@ -113,6 +114,7 @@ Caused by:
113114
}
114115

115116
#[tokio::test]
117+
#[cfg(all(feature = "valkey", feature = "cassandra"))]
116118
async fn test_shotover_shutdown_when_protocol_mismatch() {
117119
shotover_process("tests/test-configs/invalid_protocol_mismatch.yaml")
118120
.assert_fails_to_start(&[EventMatcher::new()

shotover/src/runner.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,12 @@ mod test {
396396
);
397397
match try_parse_log_directives(&[Some("good=info,bad=blah,warn")]) {
398398
Ok(_) => panic!(),
399-
Err(e) => assert_eq!(e.to_string(), "invalid filter directive: bad=blah"),
399+
Err(e) => {
400+
assert_eq!(
401+
e.to_string(),
402+
r#"error parsing level filter: expected one of "off", "error", "warn", "info", "debug", "trace", or a number 0-5: bad=blah"#
403+
)
404+
}
400405
}
401406
}
402407
}

test-helpers/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ tracing-subscriber.workspace = true
3232
anyhow.workspace = true
3333
rcgen.workspace = true
3434
rdkafka = { version = "0.37", features = ["cmake-build"], optional = true }
35+
rdkafka-sys = "=4.8.0"
3536
docker-compose-runner = "0.3.0"
36-
j4rs = "0.22.0"
37+
j4rs = "0.24.0"
3738
futures-util = "0.3.28"
3839
http = "1.1.0"
3940
rustls = { version = "0.23.18", default-features = false, features = [

test-helpers/src/cert.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use crate::run_command;
2-
use rcgen::{BasicConstraints, Certificate, CertificateParams, DnType, IsCa, KeyPair, SanType};
2+
use rcgen::{
3+
BasicConstraints, Certificate, CertificateParams, DnType, IsCa, Issuer, KeyPair, SanType,
4+
};
35
use std::path::Path;
46

57
pub fn generate_test_certs(path: &Path) {
@@ -32,16 +34,16 @@ pub fn generate_test_certs_with_bad_san(path: &Path) {
3234
}
3335

3436
pub fn generate_test_certs_with_sans(path: &Path, sans: Vec<SanType>) {
35-
let (ca_cert, ca_key) = new_ca();
36-
let (cert, cert_key) = new_cert(sans, &ca_cert, &ca_key);
37+
let (ca_cert, issuer) = new_ca();
38+
let (cert, cert_key) = new_cert(sans, &issuer);
3739

3840
std::fs::create_dir_all(path).unwrap();
3941
std::fs::write(path.join("localhost_CA.crt"), ca_cert.pem()).unwrap();
4042
std::fs::write(path.join("localhost.crt"), cert.pem()).unwrap();
4143
std::fs::write(path.join("localhost.key"), cert_key.serialize_pem()).unwrap();
4244
}
4345

44-
fn new_ca() -> (Certificate, KeyPair) {
46+
fn new_ca() -> (Certificate, Issuer<'static, KeyPair>) {
4547
let mut params = CertificateParams::default();
4648
params.is_ca = IsCa::Ca(BasicConstraints::Unconstrained);
4749
// This must be "Certificate Authority"
@@ -55,10 +57,11 @@ fn new_ca() -> (Certificate, KeyPair) {
5557

5658
let key_pair = KeyPair::generate().unwrap();
5759
let ca_cert = params.self_signed(&key_pair).unwrap();
58-
(ca_cert, key_pair)
60+
let issuer = Issuer::new(params, key_pair);
61+
(ca_cert, issuer)
5962
}
6063

61-
fn new_cert(sans: Vec<SanType>, ca_cert: &Certificate, ca_key: &KeyPair) -> (Certificate, KeyPair) {
64+
fn new_cert(sans: Vec<SanType>, issuer: &Issuer<'_, KeyPair>) -> (Certificate, KeyPair) {
6265
let mut params = CertificateParams::default();
6366

6467
// This needs to refer to the hosts that certificate will be used by
@@ -72,7 +75,7 @@ fn new_cert(sans: Vec<SanType>, ca_cert: &Certificate, ca_key: &KeyPair) -> (Cer
7275
.distinguished_name
7376
.push(DnType::OrganizationName, "ShotoverTestCertificate");
7477
let cert_key = KeyPair::generate().unwrap();
75-
let cert = params.signed_by(&cert_key, ca_cert, ca_key).unwrap();
78+
let cert = params.signed_by(&cert_key, issuer).unwrap();
7679
(cert, cert_key)
7780
}
7881

test-helpers/src/connection/cassandra/connection.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub enum CassandraConnection {
176176
#[cfg(feature = "cassandra-cpp-driver-tests")]
177177
Cpp(CppConnection),
178178
Cdrs(CdrsConnection),
179-
Scylla(ScyllaConnection),
179+
Scylla(Box<ScyllaConnection>),
180180
Java(JavaConnection),
181181
}
182182

@@ -197,9 +197,9 @@ impl CassandraConnection {
197197
CassandraDriver::Cdrs => CassandraConnection::Cdrs(
198198
CdrsConnection::new(contact_points, port, compression, tls, protocol).await,
199199
),
200-
CassandraDriver::Scylla => CassandraConnection::Scylla(
200+
CassandraDriver::Scylla => CassandraConnection::Scylla(Box::new(
201201
ScyllaConnection::new(contact_points, port, compression, tls, protocol).await,
202-
),
202+
)),
203203
CassandraDriver::Java => CassandraConnection::Java(
204204
JavaConnection::new(contact_points, port, compression, tls, protocol).await,
205205
),
@@ -242,6 +242,10 @@ impl CassandraConnection {
242242
SessionBuilderScylla::new()
243243
.known_node(direct_node)
244244
.user("cassandra", "cassandra")
245+
.auto_await_schema_agreement(false)
246+
// We do not need to refresh metadata as there is nothing else fiddling with the topology or schema.
247+
// By default the metadata refreshes every 60s and that can cause performance issues so we disable it by using an absurdly high refresh interval
248+
.cluster_metadata_refresh_interval(Duration::from_secs(10000000000))
245249
.tls_context(context)
246250
.build()
247251
.await

0 commit comments

Comments
 (0)