From bd3f4b122c57f31bbfb1193341b74cf66c5ed18c Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Tue, 9 Jan 2024 16:11:59 +1100 Subject: [PATCH] Update redis-rs --- Cargo.lock | 226 ++++++++++-------- Cargo.toml | 2 +- shotover-proxy/Cargo.toml | 5 +- shotover-proxy/benches/windsock/redis.rs | 66 ++--- .../redis_int_tests/basic_driver_tests.rs | 17 +- shotover-proxy/tests/redis_int_tests/mod.rs | 10 +- .../tests/runner/observability_int_tests.rs | 5 +- .../tests/transforms/log_to_file.rs | 27 ++- shotover-proxy/tests/transforms/tee.rs | 27 ++- shotover/src/transforms/tee.rs | 4 +- test-helpers/Cargo.toml | 2 +- 11 files changed, 218 insertions(+), 173 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7c09b234..2d2f54995 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -103,9 +103,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -175,9 +175,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" dependencies = [ "flate2", "futures-core", @@ -495,9 +495,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d8e1c0904f78c76846a9dad41c28b41d330d97741c3e70d003d9a747d95e2a" +checksum = "2eac0bb78e9e2765699999a02d7bfb4e6ad8f13e0962ebb9f5202b1d8cd76006" dependencies = [ "futures-util", "pin-project-lite", @@ -506,9 +506,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.2" +version = "0.60.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a3b159001358dd96143378afd7470e19baffb6918e4b5016abe576e553f9c" +checksum = "365ca49744b2bda2f1e2dc03b856da3fa5a28ca5b0a41e41d7ff5305a8fae190" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -526,18 +526,18 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.60.2" +version = "0.60.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12bfb23370a069f8facbfd53ce78213461b0a8570f6c81488030f5ab6f8cc4e" +checksum = "733ccdb727ac63370836aa3b3c483d75ad2ef7bc6507db3efe1d01e8d2e50367" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.60.2" +version = "0.60.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b1adc06e0175c175d280267bb8fd028143518013fcb869e1c3199569a2e902a" +checksum = "aff02ae2ee7968bbce2983ffb5ce529d24f4848532300f398347bde8c2196974" dependencies = [ "aws-smithy-types", "urlencoding", @@ -545,9 +545,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cf0f6845d2d97b953cea791b0ee37191c5509f2897ec7eb7580a0e7a594e98b" +checksum = "6ab9cb6fee50680af8ceaa293ae79eba32095ca117161cb323f9ee30dd87d139" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -570,9 +570,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47798ba97a33979c80e837519cf837f18fd6df0adb02dd5286a75d9891c6e671" +checksum = "02ca2da7619517310bfead6d18abcdde90f1439224d887d608503cfacff46dff" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -586,9 +586,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9a85eafeaf783b2408e35af599e8b96f2c49d9a5d13ad3a887fbdefb6bc744" +checksum = "5d4bb944488536cd2fef43212d829bc7e9a8bfc4afa079d21170441e7be8d2d0" dependencies = [ "base64-simd", "bytes", @@ -609,9 +609,9 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.2" +version = "0.60.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84bee2b44c22cbba59f12c34b831a97df698f8e43df579b35998652a00dc13" +checksum = "ef796feaf894d7fd03869235237aeffe73ed1b29a3927cceeee2eecadf876eba" dependencies = [ "xmlparser", ] @@ -762,9 +762,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -938,7 +938,7 @@ checksum = "81f153a0635fe493e01fe671ec77988f94ee3abd2170af653584d246ea21ce4a" dependencies = [ "arc-swap", "arrayref", - "bitflags 2.4.1", + "bitflags 2.4.2", "bytes", "chrono", "crc32fast", @@ -1090,9 +1090,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.15" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c12ed66a79a555082f595f7eb980d08669de95009dd4b3d61168c573ebe38fc9" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -1100,9 +1100,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.15" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4645eab3431e5a8403a96bea02506a8b35d28cd0f0330977dd5d22f9c84f43" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -1368,6 +1368,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.19" @@ -1917,14 +1926,15 @@ dependencies = [ [[package]] name = "fred" -version = "7.1.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a3b71b668749c2e44051378ff2e3fb1c09daba1f12e27da2a8e4b7522036a0" +checksum = "0203efc4d5c64b5178ae98641c93c9f9aac66e4f5677775e013dce495b6c75fb" dependencies = [ "arc-swap", "async-trait", "bytes", "bytes-utils", + "crossbeam-queue", "float-cmp", "futures", "lazy_static", @@ -1932,13 +1942,13 @@ dependencies = [ "parking_lot", "rand 0.8.5", "redis-protocol", - "rustls 0.21.10", - "rustls-native-certs", - "rustls-webpki 0.101.7", + "rustls 0.22.2", + "rustls-native-certs 0.7.0", + "rustls-webpki 0.102.1", "semver", "socket2 0.5.5", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls 0.25.0", "tokio-stream", "tokio-util", "url", @@ -2135,9 +2145,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -2209,9 +2219,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -2329,7 +2339,7 @@ dependencies = [ "hyper", "log", "rustls 0.21.10", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", ] @@ -2521,18 +2531,18 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] [[package]] name = "kafka-protocol" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1a96a247039fb7bd1f967a8e228331f7cae2788e57d28fb8304e4ad58c7217" +checksum = "eb8aa333dcfa9b33590f2af9e1c61d9db161cfea8d4c29f7c3be03ef371d0539" dependencies = [ "bytes", "crc", @@ -2576,7 +2586,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] @@ -2595,9 +2605,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -2794,7 +2804,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -3060,11 +3070,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.62" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -3101,9 +3111,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.98" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -3300,9 +3310,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "platforms" @@ -3406,9 +3416,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -3572,9 +3582,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -3582,9 +3592,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -3604,9 +3614,9 @@ dependencies = [ [[package]] name = "rdkafka" -version = "0.35.0" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16c17f411935214a5870e40aff9291f8b40a73e97bf8de29e5959c473d5ef33" +checksum = "1beea247b9a7600a81d4cc33f659ce1a77e1988323d7d2809c7ed1c21f4c316d" dependencies = [ "futures-channel", "futures-util", @@ -3635,9 +3645,9 @@ dependencies = [ [[package]] name = "redis" -version = "0.23.3" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f49cdc0bb3f412bf8e7d1bd90fe1d9eb10bc5c399ba90973c14662a27b3f8ba" +checksum = "c580d9cbbe1d1b479e8d67cf9daf6a62c957e6846048408b80b43ac3f6af84cd" dependencies = [ "async-trait", "bytes", @@ -3692,13 +3702,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.4", "regex-syntax 0.8.2", ] @@ -3713,9 +3723,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", @@ -3890,7 +3900,7 @@ dependencies = [ "aes", "aes-gcm", "async-trait", - "bitflags 2.4.1", + "bitflags 2.4.2", "byteorder", "chacha20", "ctr", @@ -3981,11 +3991,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -4030,6 +4040,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.0.0", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -4088,7 +4111,7 @@ version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02a2d683a4ac90aeef5b1013933f6d977bd37d51ff3f4dad829d4931a7e6be86" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "clipboard-win", "fd-lock", @@ -4303,9 +4326,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +checksum = "f58c3a1b3e418f61c25b2aeb43fc6c95eaa252b8cecdda67f401943e9e08d33f" dependencies = [ "base64", "chrono", @@ -4320,9 +4343,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +checksum = "d2068b437a31fc68f25dd7edc296b078f04b45145c199d8eed9866e45f1ff274" dependencies = [ "darling 0.20.3", "proc-macro2", @@ -4507,7 +4530,8 @@ dependencies = [ "reqwest", "rstest", "rstest_reuse", - "rustls-pemfile 1.0.4", + "rustls-pemfile 2.0.0", + "rustls-pki-types", "scylla", "serde", "serde_json", @@ -4561,9 +4585,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "snap" @@ -4636,9 +4660,9 @@ dependencies = [ [[package]] name = "ssh-key" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51901eb883a5b442b506a1f8fa483d143f3bab513fe721e398ec56c77624feb" +checksum = "01f8f4ea73476c0aa5d5e6a75ce1e8634e2c3f82005ef3bbed21547ac57f2bf7" dependencies = [ "ed25519-dalek", "p256", @@ -5033,7 +5057,7 @@ dependencies = [ "futures-util", "log", "rustls 0.21.10", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", "tungstenite 0.19.0", @@ -5281,9 +5305,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -5365,9 +5389,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom 0.2.12", "serde", @@ -5442,9 +5466,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5452,9 +5476,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -5467,9 +5491,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -5479,9 +5503,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5489,9 +5513,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -5502,15 +5526,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 8065afc3d..2947e82a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ serde = { version = "1.0.111", features = ["derive"] } serde_yaml = "0.9.17" uuid = { version = "1.0.0", features = ["serde", "v4"] } reqwest = "0.11.6" -redis = { version = "0.23.3", features = ["tokio-comp", "cluster"] } +redis = { version = "0.24.0", features = ["tokio-comp", "cluster"] } cdrs-tokio = "8.0" cassandra-protocol = "3.0" tracing = "0.1.15" diff --git a/shotover-proxy/Cargo.toml b/shotover-proxy/Cargo.toml index e63def657..34724c8a2 100644 --- a/shotover-proxy/Cargo.toml +++ b/shotover-proxy/Cargo.toml @@ -44,9 +44,10 @@ async-trait.workspace = true tracing-subscriber.workspace = true tracing-appender.workspace = true async-once-cell = "0.5.2" -fred = { version = "7.0.0", features = ["enable-rustls"] } +fred = { version = "8.0.0", features = ["enable-rustls"] } tokio-bin-process.workspace = true -rustls-pemfile = "1.0.2" +rustls-pemfile = "2.0.0" +rustls-pki-types = "1.1.0" aws-throwaway.workspace = true windsock = { path = "../windsock" } regex = "1.7.0" diff --git a/shotover-proxy/benches/windsock/redis.rs b/shotover-proxy/benches/windsock/redis.rs index 7d9c6b63a..c7cb81a8d 100644 --- a/shotover-proxy/benches/windsock/redis.rs +++ b/shotover-proxy/benches/windsock/redis.rs @@ -9,10 +9,11 @@ use async_trait::async_trait; use aws_throwaway::Ec2Instance; use fred::{ prelude::*, - rustls::{Certificate, ClientConfig, PrivateKey, RootCertStore}, + rustls::{ClientConfig, RootCertStore}, }; use itertools::Itertools; -use rustls_pemfile::{certs, Item}; +use rustls_pemfile::Item; +use rustls_pki_types::{CertificateDer, PrivateKeyDer}; use shotover::{ config::chain::TransformChainConfig, sources::SourceConfig, @@ -323,14 +324,14 @@ impl Bench for RedisBench { let mut config = RedisConfig::from_url(address).unwrap(); if let Encryption::Tls = self.encryption { - let private_key = load_private_key("tests/test-configs/redis/tls/certs/localhost.key"); - let certs = load_certs("tests/test-configs/redis/tls/certs/localhost.crt"); + let private_key = + load_private_key("tests/test-configs/redis/tls/certs/localhost.key").unwrap(); + let certs = load_certs("tests/test-configs/redis/tls/certs/localhost.crt").unwrap(); config.tls = Some( ClientConfig::builder() - .with_safe_defaults() - .with_root_certificates(load_ca( - "tests/test-configs/redis/tls/certs/localhost_CA.crt", - )) + .with_root_certificates( + load_ca("tests/test-configs/redis/tls/certs/localhost_CA.crt").unwrap(), + ) .with_client_auth_cert(certs, private_key) .unwrap() .into(), @@ -378,48 +379,29 @@ impl Bench for RedisBench { } } -// TODO: when fred updates its rustls version recopy these functions from shotover/src/tls.rs - -fn load_certs(path: &str) -> Vec { - load_certs_inner(path) - .with_context(|| format!("Failed to read certs at {path:?}")) - .unwrap() -} -fn load_certs_inner(path: &str) -> Result> { - certs(&mut BufReader::new(File::open(path)?)) +fn load_certs(path: &str) -> Result>> { + rustls_pemfile::certs(&mut BufReader::new(File::open(path)?)) + .collect::, _>>() .context("Error while parsing PEM") - .map(|certs| certs.into_iter().map(Certificate).collect()) } -fn load_private_key(path: &str) -> PrivateKey { - load_private_key_inner(path) - .with_context(|| format!("Failed to read private key at {path:?}")) - .unwrap() -} -fn load_private_key_inner(path: &str) -> Result { - let keys = rustls_pemfile::read_all(&mut BufReader::new(File::open(path)?)) - .context("Error while parsing PEM")?; - keys.into_iter() - .find_map(|item| match item { - Item::RSAKey(x) | Item::PKCS8Key(x) => Some(PrivateKey(x)), - _ => None, - }) - .ok_or_else(|| anyhow!("No suitable keys found in PEM")) +fn load_private_key(path: &str) -> Result> { + for key in rustls_pemfile::read_all(&mut BufReader::new(File::open(path)?)) { + match key.context("Error while parsing PEM")? { + Item::Pkcs8Key(x) => return Ok(x.into()), + Item::Pkcs1Key(x) => return Ok(x.into()), + _ => {} + } + } + Err(anyhow!("No suitable keys found in PEM")) } -fn load_ca(path: &str) -> RootCertStore { - load_ca_inner(path) - .with_context(|| format!("Failed to load CA at {path:?}")) - .unwrap() -} -fn load_ca_inner(path: &str) -> Result { +fn load_ca(path: &str) -> Result { let mut pem = BufReader::new(File::open(path)?); - let certs = rustls_pemfile::certs(&mut pem).context("Error while parsing PEM")?; - let mut root_cert_store = RootCertStore::empty(); - for cert in certs { + for cert in rustls_pemfile::certs(&mut pem) { root_cert_store - .add(&Certificate(cert)) + .add(cert.context("Error while parsing PEM")?) .context("Failed to add cert to cert store")?; } Ok(root_cert_store) diff --git a/shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs b/shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs index 3fc9812a7..6748be0b2 100644 --- a/shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs +++ b/shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs @@ -1,5 +1,7 @@ use crate::redis_int_tests::assert::*; use bytes::BytesMut; +use fred::clients::RedisClient; +use fred::interfaces::ClientLike; use futures::{Future, StreamExt}; use rand::{thread_rng, Rng}; use rand_distr::Alphanumeric; @@ -1265,16 +1267,13 @@ pub async fn test_dr_auth() { /// A driver variant of this test case is provided so that we can ensure that /// at least one driver handles this as we expect. -pub async fn test_trigger_transform_failure_driver(connection: &mut Connection) { +/// Fred is used here as redis-rs sends an unconfigurable `CLIENT SETINFO` command and ignores the result on connection init. +/// This results in the error message being completely dropped with redis-rs. +pub async fn test_trigger_transform_failure_driver(client: &RedisClient) { assert_eq!( - redis::cmd("SET") - .arg("foo") - .arg(42) - .query_async::<_, ()>(connection) - .await - .unwrap_err() - .to_string(), - "An error was signalled by the server - ResponseError: Internal shotover (or custom transform) bug: Chain failed to send and/or receive messages, the connection will now be closed. Caused by: 0: RedisSinkSingle transform failed 1: Failed to connect to destination \"127.0.0.1:1111\" 2: Connection refused (os error 111)".to_string() + // fred sends a `CLIENT` command on startup to which shotover will reply with an error + client.wait_for_connect().await.unwrap_err().details(), + "ERR Internal shotover (or custom transform) bug: Chain failed to send and/or receive messages, the connection will now be closed. Caused by: 0: RedisSinkSingle transform failed 1: Failed to connect to destination \"127.0.0.1:1111\" 2: Connection refused (os error 111)".to_string() ); } diff --git a/shotover-proxy/tests/redis_int_tests/mod.rs b/shotover-proxy/tests/redis_int_tests/mod.rs index fd31fefb9..e33799534 100644 --- a/shotover-proxy/tests/redis_int_tests/mod.rs +++ b/shotover-proxy/tests/redis_int_tests/mod.rs @@ -1,5 +1,8 @@ use crate::shotover_process; use basic_driver_tests::*; +use fred::clients::RedisClient; +use fred::interfaces::ClientLike; +use fred::types::RedisConfig; use redis::aio::Connection; use redis::Commands; @@ -47,9 +50,12 @@ async fn passthrough_redis_down() { let shotover = shotover_process("tests/test-configs/redis/passthrough/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let client = RedisClient::new(RedisConfig::default(), None, None, None); - test_trigger_transform_failure_driver(&mut connection).await; + { + let _shutdown_handle = client.connect(); + test_trigger_transform_failure_driver(&client).await; + } test_trigger_transform_failure_raw().await; test_invalid_frame().await; diff --git a/shotover-proxy/tests/runner/observability_int_tests.rs b/shotover-proxy/tests/runner/observability_int_tests.rs index ba184042a..f3e679d69 100644 --- a/shotover-proxy/tests/runner/observability_int_tests.rs +++ b/shotover-proxy/tests/runner/observability_int_tests.rs @@ -7,7 +7,6 @@ async fn test_metrics() { let shotover = shotover_process("tests/test-configs/null-redis/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; // Expected string looks unnatural because it is sorted in alphabetical order to make it match the sorted error output let expected = r#" @@ -98,7 +97,8 @@ shotover_transform_total_count{transform="QueryCounter"} "#; assert_metrics_has_keys("", expected).await; - // Check we still get the metrics after sending a couple requests + let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + redis::cmd("SET") .arg("the_key") .arg(42) @@ -131,6 +131,7 @@ shotover_chain_latency_seconds{chain="redis",client_details="127.0.0.1",quantile shotover_chain_latency_seconds{chain="redis",client_details="127.0.0.1",quantile="0.99"} shotover_chain_latency_seconds{chain="redis",client_details="127.0.0.1",quantile="0.999"} shotover_chain_latency_seconds{chain="redis",client_details="127.0.0.1",quantile="1"} +shotover_query_count{name="redis-chain",query="CLIENT",type="redis"} shotover_query_count{name="redis-chain",query="GET",type="redis"} shotover_query_count{name="redis-chain",query="SET",type="redis"} "#; diff --git a/shotover-proxy/tests/transforms/log_to_file.rs b/shotover-proxy/tests/transforms/log_to_file.rs index 4011700ab..a02b800df 100644 --- a/shotover-proxy/tests/transforms/log_to_file.rs +++ b/shotover-proxy/tests/transforms/log_to_file.rs @@ -11,13 +11,34 @@ async fn log_to_file() { .start() .await; + // CLIENT SETINFO requests sent by driver during connection handshake let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let request = std::fs::read("message-log/1/requests/message1.bin").unwrap(); + assert_eq_string( + &request, + "*4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$8\r\nLIB-NAME\r\n$8\r\nredis-rs\r\n", + ); + let response = std::fs::read("message-log/1/responses/message1.bin").unwrap(); + assert_eq_string( + &response, + "-ERR Unknown subcommand or wrong number of arguments for 'SETINFO'. Try CLIENT HELP\r\n", + ); + let request = std::fs::read("message-log/1/requests/message2.bin").unwrap(); + assert_eq_string( + &request, + "*4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$7\r\nLIB-VER\r\n$6\r\n0.24.0\r\n", + ); + let response = std::fs::read("message-log/1/responses/message2.bin").unwrap(); + assert_eq_string( + &response, + "-ERR Unknown subcommand or wrong number of arguments for 'SETINFO'. Try CLIENT HELP\r\n", + ); + // SET sent by command assert_ok(redis::cmd("SET").arg("foo").arg(42), &mut connection).await; - let request = std::fs::read("message-log/1/requests/message1.bin").unwrap(); + let request = std::fs::read("message-log/1/requests/message3.bin").unwrap(); assert_eq_string(&request, "*3\r\n$3\r\nSET\r\n$3\r\nfoo\r\n$2\r\n42\r\n"); - - let response = std::fs::read("message-log/1/responses/message1.bin").unwrap(); + let response = std::fs::read("message-log/1/responses/message3.bin").unwrap(); assert_eq_string(&response, "+OK\r\n"); shotover.shutdown_and_then_consume_events(&[]).await; diff --git a/shotover-proxy/tests/transforms/tee.rs b/shotover-proxy/tests/transforms/tee.rs index 1f944d2ee..92b09a5bb 100644 --- a/shotover-proxy/tests/transforms/tee.rs +++ b/shotover-proxy/tests/transforms/tee.rs @@ -78,14 +78,24 @@ async fn test_log_with_mismatch() { assert_eq!("42", result); shotover - .shutdown_and_then_consume_events(&[EventMatcher::new() - .with_level(Level::Warn) - .with_target("shotover::transforms::tee") - .with_message( - r#"Tee mismatch: -chain response: ["Redis BulkString(b\"42\"))"] + .shutdown_and_then_consume_events(&[ + EventMatcher::new() + .with_level(Level::Warn) + .with_target("shotover::transforms::tee") + .with_message( + r#"Tee mismatch: +chain response: ["Redis BulkString(b\"42\"))", "Redis BulkString(b\"42\"))"] +tee response: ["Redis BulkString(b\"41\"))", "Redis BulkString(b\"41\"))"]"#, + ), + EventMatcher::new() + .with_level(Level::Warn) + .with_target("shotover::transforms::tee") + .with_message( + r#"Tee mismatch: +chain response: ["Redis BulkString(b\"42\"))"] tee response: ["Redis BulkString(b\"41\"))"]"#, - )]) + ), + ]) .await; } @@ -287,6 +297,7 @@ async fn test_switch_main_chain() { shotover .shutdown_and_then_consume_events(&[EventMatcher::new() .with_level(Level::Warn) - .with_count(tokio_bin_process::event_matcher::Count::Times(3))]) + // 1 warning per loop above + 1 warning from the redis-rs driver connection handshake + .with_count(tokio_bin_process::event_matcher::Count::Times(4))]) .await; } diff --git a/shotover/src/transforms/tee.rs b/shotover/src/transforms/tee.rs index c744679aa..84c9b74bd 100644 --- a/shotover/src/transforms/tee.rs +++ b/shotover/src/transforms/tee.rs @@ -213,7 +213,7 @@ impl Transform for Tee { if !chain_response.eq(&tee_response) { debug!( - "Tee mismatch: \nchain response: {:?} \ntee response: {:?}", + "Tee mismatch:\nchain response: {:?}\ntee response: {:?}", chain_response .iter_mut() .map(|m| m.to_high_level_string()) @@ -261,7 +261,7 @@ impl Transform for Tee { if !chain_response.eq(&tee_response) { warn!( - "Tee mismatch: \nchain response: {:?} \ntee response: {:?}", + "Tee mismatch:\nchain response: {:?}\ntee response: {:?}", chain_response .iter_mut() .map(|m| m.to_high_level_string()) diff --git a/test-helpers/Cargo.toml b/test-helpers/Cargo.toml index 168ea790c..032178fa4 100644 --- a/test-helpers/Cargo.toml +++ b/test-helpers/Cargo.toml @@ -32,7 +32,7 @@ tracing-subscriber.workspace = true serde_yaml.workspace = true anyhow.workspace = true rcgen.workspace = true -rdkafka = { version = "0.35", features = ["cmake-build"], optional = true } +rdkafka = { version = "0.36", features = ["cmake-build"], optional = true } docker-compose-runner = "0.3.0" # TODO: make scylla reexport these so we dont have to import random old versions bigdecimal = "0.2.2"