diff --git a/Cargo.lock b/Cargo.lock index 9f89db791ed39..bc402702e7c75 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,21 +111,21 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrow-flight" version = "0.1.0" -source = "git+https://github.com/datafuse-extras/arrow2?rev=43c101f#43c101f56251367b4bffb1369f09f096edaa4a20" +source = "git+https://github.com/psiace/arrow2?rev=5187d3d#5187d3d5275a019a5aae5fc72057aff37464d546" dependencies = [ "arrow2", "bytes", "futures", - "prost 0.7.0", - "prost-derive 0.7.0", + "prost", + "prost-derive", "tokio", "tonic", ] [[package]] name = "arrow2" -version = "0.3.0" -source = "git+https://github.com/datafuse-extras/arrow2?rev=43c101f#43c101f56251367b4bffb1369f09f096edaa4a20" +version = "0.4.0" +source = "git+https://github.com/psiace/arrow2?rev=5187d3d#5187d3d5275a019a5aae5fc72057aff37464d546" dependencies = [ "ahash 0.7.4", "base64", @@ -137,7 +137,7 @@ dependencies = [ "hash_hasher", "hex", "indexmap", - "itertools 0.10.1", + "itertools", "lazy_static", "lexical-core", "lz4", @@ -779,7 +779,7 @@ dependencies = [ "anyhow", "backtrace", "common-arrow", - "prost 0.7.0", + "prost", "serde", "serde_json", "sqlparser", @@ -808,7 +808,7 @@ dependencies = [ "lazy_static", "log", "pretty_assertions", - "prost 0.7.0", + "prost", "serde", "serde_json", "tokio-stream", @@ -1073,7 +1073,7 @@ dependencies = [ "clap", "criterion-plot", "csv", - "itertools 0.10.1", + "itertools", "lazy_static", "num-traits", "oorandom", @@ -1095,7 +1095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" dependencies = [ "cast", - "itertools 0.10.1", + "itertools", ] [[package]] @@ -1430,7 +1430,7 @@ dependencies = [ "paste", "pnet", "pretty_assertions", - "prost 0.7.0", + "prost", "quantiles", "rand 0.8.4", "reqwest", @@ -1481,7 +1481,7 @@ dependencies = [ "num", "num_cpus", "pretty_assertions", - "prost 0.7.0", + "prost", "rand 0.8.4", "serde", "serde_json", @@ -2389,6 +2389,18 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -2540,15 +2552,6 @@ dependencies = [ "serde", ] -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.10.1" @@ -3858,9 +3861,9 @@ dependencies = [ "log", "nix 0.20.1", "parking_lot", - "prost 0.8.0", - "prost-build 0.8.0", - "prost-derive 0.8.0", + "prost", + "prost-build", + "prost-derive", "symbolic-demangle", "tempfile", "thiserror", @@ -3893,7 +3896,7 @@ checksum = "c143348f141cc87aab5b950021bac6145d0e5ae754b0591de23244cee42c9308" dependencies = [ "difflib", "float-cmp 0.9.0", - "itertools 0.10.1", + "itertools", "normalize-line-endings", "predicates-core", "regex", @@ -3972,16 +3975,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "prost" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" -dependencies = [ - "bytes", - "prost-derive 0.7.0", -] - [[package]] name = "prost" version = "0.8.0" @@ -3989,25 +3982,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" dependencies = [ "bytes", - "prost-derive 0.8.0", -] - -[[package]] -name = "prost-build" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" -dependencies = [ - "bytes", - "heck", - "itertools 0.9.0", - "log", - "multimap", - "petgraph", - "prost 0.7.0", - "prost-types 0.7.0", - "tempfile", - "which 4.2.2", + "prost-derive", ] [[package]] @@ -4018,29 +3993,16 @@ checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" dependencies = [ "bytes", "heck", - "itertools 0.10.1", + "itertools", "log", "multimap", "petgraph", - "prost 0.8.0", - "prost-types 0.8.0", + "prost", + "prost-types", "tempfile", "which 4.2.2", ] -[[package]] -name = "prost-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" -dependencies = [ - "anyhow", - "itertools 0.9.0", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "prost-derive" version = "0.8.0" @@ -4048,22 +4010,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" dependencies = [ "anyhow", - "itertools 0.10.1", + "itertools", "proc-macro2", "quote", "syn", ] -[[package]] -name = "prost-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" -dependencies = [ - "bytes", - "prost 0.7.0", -] - [[package]] name = "prost-types" version = "0.8.0" @@ -4071,7 +4023,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" dependencies = [ "bytes", - "prost 0.8.0", + "prost", ] [[package]] @@ -5444,6 +5396,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "tokio-io-timeout" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9" +dependencies = [ + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-macros" version = "1.3.0" @@ -5527,9 +5489,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac42cd97ac6bd2339af5bcabf105540e21e45636ec6fa6aae5e85d44db31be0" +checksum = "796c5e1cd49905e65dd8e700d4cb1dffcbfdb4fc9d017de08c1a537afd83627c" dependencies = [ "async-stream", "async-trait", @@ -5541,16 +5503,18 @@ dependencies = [ "http", "http-body", "hyper", + "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.7.0", - "prost-derive 0.7.0", + "prost", + "prost-derive", "rustls-native-certs", "tokio", "tokio-rustls", "tokio-stream", "tokio-util", "tower", + "tower-layer", "tower-service", "tracing", "tracing-futures", @@ -5558,12 +5522,12 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.4.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c695de27302f4697191dda1c7178131a8cb805463dda02864acb80fe1322fdcf" +checksum = "12b52d07035516c2b74337d2ac7746075e7dcae7643816c1b12c5ff8a7484c08" dependencies = [ "proc-macro2", - "prost-build 0.7.0", + "prost-build", "quote", "syn", ] diff --git a/common/arrow/Cargo.toml b/common/arrow/Cargo.toml index 14fe17690c6ea..a9bef2d15a2f2 100644 --- a/common/arrow/Cargo.toml +++ b/common/arrow/Cargo.toml @@ -15,8 +15,8 @@ simd = ["arrow/simd"] # Workspace dependencies # Github dependencies -arrow = { package = "arrow2", git="https://github.com/datafuse-extras/arrow2", rev = "43c101f" } -arrow-flight = { git="https://github.com/datafuse-extras/arrow2", rev = "43c101f" } +arrow = { package = "arrow2", git="https://github.com/psiace/arrow2", rev = "5187d3d" } +arrow-flight = { git="https://github.com/psiace/arrow2", rev = "5187d3d" } parquet = {package = "parquet2", git = "https://github.com/datafuse-extras/parquet2", rev = "05854c0"} # Crates.io dependencies diff --git a/common/exception/Cargo.toml b/common/exception/Cargo.toml index 9b88455d52fe9..cd432634df77f 100644 --- a/common/exception/Cargo.toml +++ b/common/exception/Cargo.toml @@ -16,8 +16,8 @@ backtrace = "0.3.60" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0.26" -tonic = "0.4.3" -prost = "0.7.0" +tonic = "0.5.2" +prost = "0.8.0" # Github dependencies sqlparser = { git = "https://github.com/datafuse-extras/sqlparser-rs", rev = "2535347" } diff --git a/common/flights/Cargo.toml b/common/flights/Cargo.toml index 2c857472cba00..f4044b364123b 100644 --- a/common/flights/Cargo.toml +++ b/common/flights/Cargo.toml @@ -27,11 +27,11 @@ common-store-api= {path = "../store-api"} futures = "0.3" jwt-simple = "0.10.4" log = "0.4" -prost = "0.7" +prost = "0.8.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio-stream = "0.1" -tonic = { version = "0.4.3", features = ["transport", "codegen", "prost", "tls-roots", "tls"] } +tonic = { version = "0.5.2", features = ["transport", "codegen", "prost", "tls-roots", "tls"] } hyper = "0.14.12" lazy_static = "1.4.0" trust-dns-resolver = { version = "0.20.3", features = ["system-config"] } @@ -41,4 +41,4 @@ async-trait = "0.1" pretty_assertions = "0.7" [build-dependencies] -tonic-build = "0.4" +tonic-build = "0.5.2" diff --git a/common/flights/src/store_client.rs b/common/flights/src/store_client.rs index 56cf8501da5e1..f62c5624ae29a 100644 --- a/common/flights/src/store_client.rs +++ b/common/flights/src/store_client.rs @@ -27,7 +27,9 @@ use futures::StreamExt; use log::info; use prost::Message; use serde::de::DeserializeOwned; +use tonic::codegen::InterceptedService; use tonic::metadata::MetadataValue; +use tonic::service::Interceptor; use tonic::transport::Channel; use tonic::Request; @@ -41,7 +43,7 @@ use crate::RpcClientTlsConfig; pub struct StoreClient { token: Vec, pub(crate) timeout: Duration, - pub(crate) client: FlightServiceClient, + pub(crate) client: FlightServiceClient>, } static AUTH_TOKEN_KEY: &str = "auth-token-bin"; @@ -73,11 +75,7 @@ impl StoreClient { let client = { let token = token.clone(); - FlightServiceClient::with_interceptor(channel, move |mut req: Request<()>| { - let metadata = req.metadata_mut(); - metadata.insert_bin(AUTH_TOKEN_KEY, MetadataValue::from_bytes(&token)); - Ok(req) - }) + FlightServiceClient::with_interceptor(channel, AuthInterceptor { token }) }; let rx = Self { @@ -150,3 +148,19 @@ impl StoreClient { } } } + +#[derive(Clone)] +pub struct AuthInterceptor { + pub token: Vec, +} + +impl Interceptor for AuthInterceptor { + fn call( + &mut self, + mut req: tonic::Request<()>, + ) -> std::result::Result, tonic::Status> { + let metadata = req.metadata_mut(); + metadata.insert_bin(AUTH_TOKEN_KEY, MetadataValue::from_bytes(&self.token)); + Ok(req) + } +} diff --git a/common/tracing/Cargo.toml b/common/tracing/Cargo.toml index 44f2e4ef38fce..dbc913e5fadd2 100644 --- a/common/tracing/Cargo.toml +++ b/common/tracing/Cargo.toml @@ -12,7 +12,7 @@ edition = "2021" lazy_static = "1.4.0" opentelemetry = { version = "0.16", default-features = false, features = ["trace", "rt-tokio"] } opentelemetry-jaeger = { version = "0.15", features = ["rt-tokio"] } -tonic = "0.4.3" +tonic = "0.5.2" tracing = "0.1.26" tracing-appender = "0.1.2" tracing-bunyan-formatter = "0.2" diff --git a/query/Cargo.toml b/query/Cargo.toml index aec778813e6b5..2457d77a31446 100644 --- a/query/Cargo.toml +++ b/query/Cargo.toml @@ -66,7 +66,7 @@ nom = "7.0.0" num_cpus = "1.0" paste = "^1.0" pnet = "0.28.0" -prost = "0.7" +prost = "0.8.0" rand = "0.8.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -75,7 +75,7 @@ structopt-toml = "0.5.0" threadpool = "1.8.1" tokio-stream = { version = "0.1", features = ["net"] } toml = "0.5.6" -tonic = "0.4.3" +tonic = "0.5.2" walkdir = "2.3.2" warp = { version = "0.3.1", features = ["tls"] } uuid = { version = "0.8", features = ["serde", "v4"] } diff --git a/store/Cargo.toml b/store/Cargo.toml index 25e3d35a8a67e..9765fce7b8815 100644 --- a/store/Cargo.toml +++ b/store/Cargo.toml @@ -49,7 +49,7 @@ metrics = "0.17.0" metrics-exporter-prometheus = "0.6.0" num = "0.4" num_cpus = "1.0" -prost = "0.7" +prost = "0.8.0" rand = "0.8.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -61,7 +61,7 @@ thiserror = "1.0.26" threadpool = "1.8.1" tokio-stream = "0.1" tracing-appender = "0.1.2" -tonic = { version = "0.4.3", features = ["tls"]} +tonic = { version = "0.5.2", features = ["tls"]} sha2 = "0.9.5" uuid = { version = "0.8", features = ["serde", "v4"] } @@ -75,4 +75,4 @@ flaky_test = "0.1" [build-dependencies] common-building = {path = "../common/building"} -tonic-build = "0.4" +tonic-build = "0.5.2"