mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-06 13:02:55 +00:00
Update most of the dependencies to their latest versions (#4026)
See https://github.com/neondatabase/neon/pull/3991 Brings the changes back with the right way to use new `toml_edit` to deserialize values and a unit test for this. All non-trivial updates extracted into separate commits, also `carho hakari` data and its manifest format were updated. 3 sets of crates remain unupdated: * `base64` — touches proxy in a lot of places and changed its api (by 0.21 version) quite strongly since our version (0.13). * `opentelemetry` and `opentelemetry-*` crates ``` error[E0308]: mismatched types --> libs/tracing-utils/src/http.rs:65:21 | 65 | span.set_parent(parent_ctx); | ---------- ^^^^^^^^^^ expected struct `opentelemetry_api::context::Context`, found struct `opentelemetry::Context` | | | arguments to this method are incorrect | = note: struct `opentelemetry::Context` and struct `opentelemetry_api::context::Context` have similar names, but are actually distinct types note: struct `opentelemetry::Context` is defined in crate `opentelemetry_api` --> /Users/someonetoignore/.cargo/registry/src/github.com-1ecc6299db9ec823/opentelemetry_api-0.19.0/src/context.rs:77:1 | 77 | pub struct Context { | ^^^^^^^^^^^^^^^^^^ note: struct `opentelemetry_api::context::Context` is defined in crate `opentelemetry_api` --> /Users/someonetoignore/.cargo/registry/src/github.com-1ecc6299db9ec823/opentelemetry_api-0.18.0/src/context.rs:77:1 | 77 | pub struct Context { | ^^^^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate `opentelemetry_api` are being used? note: associated function defined here --> /Users/someonetoignore/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-opentelemetry-0.18.0/src/span_ext.rs:43:8 | 43 | fn set_parent(&self, cx: Context); | ^^^^^^^^^^ For more information about this error, try `rustc --explain E0308`. error: could not compile `tracing-utils` due to previous error warning: build failed, waiting for other jobs to finish... error: could not compile `tracing-utils` due to previous error ``` `tracing-opentelemetry` of version `0.19` is not yet released, that is supposed to have the update we need. * similarly, `rustls`, `tokio-rustls`, `rustls-*` and `tls-listener` crates have similar issue: ``` error[E0308]: mismatched types --> libs/postgres_backend/tests/simple_select.rs:112:78 | 112 | let mut make_tls_connect = tokio_postgres_rustls::MakeRustlsConnect::new(client_cfg); | --------------------------------------------- ^^^^^^^^^^ expected struct `rustls::client::client_conn::ClientConfig`, found struct `ClientConfig` | | | arguments to this function are incorrect | = note: struct `ClientConfig` and struct `rustls::client::client_conn::ClientConfig` have similar names, but are actually distinct types note: struct `ClientConfig` is defined in crate `rustls` --> /Users/someonetoignore/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.21.0/src/client/client_conn.rs:125:1 | 125 | pub struct ClientConfig { | ^^^^^^^^^^^^^^^^^^^^^^^ note: struct `rustls::client::client_conn::ClientConfig` is defined in crate `rustls` --> /Users/someonetoignore/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.8/src/client/client_conn.rs:91:1 | 91 | pub struct ClientConfig { | ^^^^^^^^^^^^^^^^^^^^^^^ = note: perhaps two different versions of crate `rustls` are being used? note: associated function defined here --> /Users/someonetoignore/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-postgres-rustls-0.9.0/src/lib.rs:23:12 | 23 | pub fn new(config: ClientConfig) -> Self { | ^^^ For more information about this error, try `rustc --explain E0308`. error: could not compile `postgres_backend` due to previous error warning: build failed, waiting for other jobs to finish... ``` * aws crates: I could not make new API to work with bucket endpoint overload, and console e2e tests failed. Other our tests passed, further investigation is worth to be done in https://github.com/neondatabase/neon/issues/4008
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
hakari-package = "workspace_hack"
|
hakari-package = "workspace_hack"
|
||||||
|
|
||||||
# Format for `workspace-hack = ...` lines in other Cargo.tomls. Requires cargo-hakari 0.9.8 or above.
|
# Format for `workspace-hack = ...` lines in other Cargo.tomls. Requires cargo-hakari 0.9.8 or above.
|
||||||
dep-format-version = "3"
|
dep-format-version = "4"
|
||||||
|
|
||||||
# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended.
|
# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended.
|
||||||
# Hakari works much better with the new feature resolver.
|
# Hakari works much better with the new feature resolver.
|
||||||
|
|||||||
1406
Cargo.lock
generated
1406
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
26
Cargo.toml
26
Cargo.toml
@@ -24,10 +24,10 @@ atty = "0.2.14"
|
|||||||
aws-config = { version = "0.51.0", default-features = false, features=["rustls"] }
|
aws-config = { version = "0.51.0", default-features = false, features=["rustls"] }
|
||||||
aws-sdk-s3 = "0.21.0"
|
aws-sdk-s3 = "0.21.0"
|
||||||
aws-smithy-http = "0.51.0"
|
aws-smithy-http = "0.51.0"
|
||||||
aws-types = "0.51.0"
|
aws-types = "0.55"
|
||||||
base64 = "0.13.0"
|
base64 = "0.13.0"
|
||||||
bincode = "1.3"
|
bincode = "1.3"
|
||||||
bindgen = "0.61"
|
bindgen = "0.65"
|
||||||
bstr = "1.0"
|
bstr = "1.0"
|
||||||
byteorder = "1.4"
|
byteorder = "1.4"
|
||||||
bytes = "1.0"
|
bytes = "1.0"
|
||||||
@@ -50,7 +50,7 @@ git-version = "0.3"
|
|||||||
hashbrown = "0.13"
|
hashbrown = "0.13"
|
||||||
hashlink = "0.8.1"
|
hashlink = "0.8.1"
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
hex-literal = "0.3"
|
hex-literal = "0.4"
|
||||||
hmac = "0.12.1"
|
hmac = "0.12.1"
|
||||||
hostname = "0.3.1"
|
hostname = "0.3.1"
|
||||||
humantime = "2.1"
|
humantime = "2.1"
|
||||||
@@ -80,18 +80,18 @@ reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"
|
|||||||
reqwest-tracing = { version = "0.4.0", features = ["opentelemetry_0_18"] }
|
reqwest-tracing = { version = "0.4.0", features = ["opentelemetry_0_18"] }
|
||||||
reqwest-middleware = "0.2.0"
|
reqwest-middleware = "0.2.0"
|
||||||
routerify = "3"
|
routerify = "3"
|
||||||
rpds = "0.12.0"
|
rpds = "0.13"
|
||||||
rustls = "0.20"
|
rustls = "0.20"
|
||||||
rustls-pemfile = "1"
|
rustls-pemfile = "1"
|
||||||
rustls-split = "0.3"
|
rustls-split = "0.3"
|
||||||
scopeguard = "1.1"
|
scopeguard = "1.1"
|
||||||
sentry = { version = "0.29", default-features = false, features = ["backtrace", "contexts", "panic", "rustls", "reqwest" ] }
|
sentry = { version = "0.30", default-features = false, features = ["backtrace", "contexts", "panic", "rustls", "reqwest" ] }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
serde_with = "2.0"
|
serde_with = "2.0"
|
||||||
sha2 = "0.10.2"
|
sha2 = "0.10.2"
|
||||||
signal-hook = "0.3"
|
signal-hook = "0.3"
|
||||||
socket2 = "0.4.4"
|
socket2 = "0.5"
|
||||||
strum = "0.24"
|
strum = "0.24"
|
||||||
strum_macros = "0.24"
|
strum_macros = "0.24"
|
||||||
svg_fmt = "0.4.1"
|
svg_fmt = "0.4.1"
|
||||||
@@ -106,17 +106,17 @@ tokio-postgres-rustls = "0.9.0"
|
|||||||
tokio-rustls = "0.23"
|
tokio-rustls = "0.23"
|
||||||
tokio-stream = "0.1"
|
tokio-stream = "0.1"
|
||||||
tokio-util = { version = "0.7", features = ["io"] }
|
tokio-util = { version = "0.7", features = ["io"] }
|
||||||
toml = "0.5"
|
toml = "0.7"
|
||||||
toml_edit = { version = "0.17", features = ["easy"] }
|
toml_edit = "0.19"
|
||||||
tonic = {version = "0.8", features = ["tls", "tls-roots"]}
|
tonic = {version = "0.9", features = ["tls", "tls-roots"]}
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-opentelemetry = "0.18.0"
|
tracing-opentelemetry = "0.18.0"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
url = "2.2"
|
url = "2.2"
|
||||||
uuid = { version = "1.2", features = ["v4", "serde"] }
|
uuid = { version = "1.2", features = ["v4", "serde"] }
|
||||||
walkdir = "2.3.2"
|
walkdir = "2.3.2"
|
||||||
webpki-roots = "0.22.5"
|
webpki-roots = "0.23"
|
||||||
x509-parser = "0.14"
|
x509-parser = "0.15"
|
||||||
|
|
||||||
## TODO replace this with tracing
|
## TODO replace this with tracing
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
@@ -154,9 +154,9 @@ workspace_hack = { version = "0.1", path = "./workspace_hack/" }
|
|||||||
## Build dependencies
|
## Build dependencies
|
||||||
criterion = "0.4"
|
criterion = "0.4"
|
||||||
rcgen = "0.10"
|
rcgen = "0.10"
|
||||||
rstest = "0.16"
|
rstest = "0.17"
|
||||||
tempfile = "3.4"
|
tempfile = "3.4"
|
||||||
tonic-build = "0.8"
|
tonic-build = "0.9"
|
||||||
|
|
||||||
# This is only needed for proxy's tests.
|
# This is only needed for proxy's tests.
|
||||||
# TODO: we should probably fork `tokio-postgres-rustls` instead.
|
# TODO: we should probably fork `tokio-postgres-rustls` instead.
|
||||||
|
|||||||
@@ -4,13 +4,12 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.68"
|
anyhow.workspace = true
|
||||||
chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] }
|
chrono.workspace = true
|
||||||
rand = "0.8.3"
|
rand.workspace = true
|
||||||
serde = "1.0.152"
|
serde.workspace = true
|
||||||
serde_with = "2.1.0"
|
serde_with.workspace = true
|
||||||
utils = { version = "0.1.0", path = "../utils" }
|
utils.workspace = true
|
||||||
workspace_hack = { version = "0.1.0", path = "../../workspace_hack" }
|
|
||||||
|
workspace_hack.workspace = true
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use std::path::PathBuf;
|
|||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use bindgen::callbacks::ParseCallbacks;
|
use bindgen::callbacks::{DeriveInfo, ParseCallbacks};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct PostgresFfiCallbacks;
|
struct PostgresFfiCallbacks;
|
||||||
@@ -20,7 +20,7 @@ impl ParseCallbacks for PostgresFfiCallbacks {
|
|||||||
|
|
||||||
// Add any custom #[derive] attributes to the data structures that bindgen
|
// Add any custom #[derive] attributes to the data structures that bindgen
|
||||||
// creates.
|
// creates.
|
||||||
fn add_derives(&self, name: &str) -> Vec<String> {
|
fn add_derives(&self, derive_info: &DeriveInfo) -> Vec<String> {
|
||||||
// This is the list of data structures that we want to serialize/deserialize.
|
// This is the list of data structures that we want to serialize/deserialize.
|
||||||
let serde_list = [
|
let serde_list = [
|
||||||
"XLogRecord",
|
"XLogRecord",
|
||||||
@@ -31,7 +31,7 @@ impl ParseCallbacks for PostgresFfiCallbacks {
|
|||||||
"ControlFileData",
|
"ControlFileData",
|
||||||
];
|
];
|
||||||
|
|
||||||
if serde_list.contains(&name) {
|
if serde_list.contains(&derive_info.name) {
|
||||||
vec![
|
vec![
|
||||||
"Default".into(), // Default allows us to easily fill the padding fields with 0.
|
"Default".into(), // Default allows us to easily fill the padding fields with 0.
|
||||||
"Serialize".into(),
|
"Serialize".into(),
|
||||||
|
|||||||
@@ -204,12 +204,7 @@ async fn upload_s3_data(
|
|||||||
let data = format!("remote blob data {i}").into_bytes();
|
let data = format!("remote blob data {i}").into_bytes();
|
||||||
let data_len = data.len();
|
let data_len = data.len();
|
||||||
task_client
|
task_client
|
||||||
.upload(
|
.upload(std::io::Cursor::new(data), data_len, &blob_path, None)
|
||||||
Box::new(std::io::Cursor::new(data)),
|
|
||||||
data_len,
|
|
||||||
&blob_path,
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok::<_, anyhow::Error>((blob_prefix, blob_path))
|
Ok::<_, anyhow::Error>((blob_prefix, blob_path))
|
||||||
|
|||||||
@@ -14,4 +14,5 @@ tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
|
|||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
tracing-opentelemetry.workspace = true
|
tracing-opentelemetry.workspace = true
|
||||||
tracing-subscriber.workspace = true
|
tracing-subscriber.workspace = true
|
||||||
workspace_hack = { version = "0.1", path = "../../workspace_hack" }
|
|
||||||
|
workspace_hack.workspace = true
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ serde_with.workspace = true
|
|||||||
strum.workspace = true
|
strum.workspace = true
|
||||||
strum_macros.workspace = true
|
strum_macros.workspace = true
|
||||||
url.workspace = true
|
url.workspace = true
|
||||||
uuid = { version = "1.2", features = ["v4", "serde"] }
|
uuid.workspace = true
|
||||||
|
|
||||||
metrics.workspace = true
|
metrics.workspace = true
|
||||||
workspace_hack.workspace = true
|
workspace_hack.workspace = true
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
use anyhow::{anyhow, bail, ensure, Context, Result};
|
use anyhow::{anyhow, bail, ensure, Context, Result};
|
||||||
use remote_storage::{RemotePath, RemoteStorageConfig};
|
use remote_storage::{RemotePath, RemoteStorageConfig};
|
||||||
|
use serde::de::IntoDeserializer;
|
||||||
use std::env;
|
use std::env;
|
||||||
use storage_broker::Uri;
|
use storage_broker::Uri;
|
||||||
use utils::crashsafe::path_with_suffix_extension;
|
use utils::crashsafe::path_with_suffix_extension;
|
||||||
@@ -704,8 +705,9 @@ impl PageServerConf {
|
|||||||
"disk_usage_based_eviction" => {
|
"disk_usage_based_eviction" => {
|
||||||
tracing::info!("disk_usage_based_eviction: {:#?}", &item);
|
tracing::info!("disk_usage_based_eviction: {:#?}", &item);
|
||||||
builder.disk_usage_based_eviction(
|
builder.disk_usage_based_eviction(
|
||||||
toml_edit::de::from_item(item.clone())
|
deserialize_from_item("disk_usage_based_eviction", item)
|
||||||
.context("parse disk_usage_based_eviction")?)
|
.context("parse disk_usage_based_eviction")?
|
||||||
|
)
|
||||||
},
|
},
|
||||||
"ondemand_download_behavior_treat_error_as_warn" => builder.ondemand_download_behavior_treat_error_as_warn(parse_toml_bool(key, item)?),
|
"ondemand_download_behavior_treat_error_as_warn" => builder.ondemand_download_behavior_treat_error_as_warn(parse_toml_bool(key, item)?),
|
||||||
_ => bail!("unrecognized pageserver option '{key}'"),
|
_ => bail!("unrecognized pageserver option '{key}'"),
|
||||||
@@ -806,14 +808,14 @@ impl PageServerConf {
|
|||||||
|
|
||||||
if let Some(eviction_policy) = item.get("eviction_policy") {
|
if let Some(eviction_policy) = item.get("eviction_policy") {
|
||||||
t_conf.eviction_policy = Some(
|
t_conf.eviction_policy = Some(
|
||||||
toml_edit::de::from_item(eviction_policy.clone())
|
deserialize_from_item("eviction_policy", eviction_policy)
|
||||||
.context("parse eviction_policy")?,
|
.context("parse eviction_policy")?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(item) = item.get("min_resident_size_override") {
|
if let Some(item) = item.get("min_resident_size_override") {
|
||||||
t_conf.min_resident_size_override = Some(
|
t_conf.min_resident_size_override = Some(
|
||||||
toml_edit::de::from_item(item.clone())
|
deserialize_from_item("min_resident_size_override", item)
|
||||||
.context("parse min_resident_size_override")?,
|
.context("parse min_resident_size_override")?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -920,6 +922,18 @@ where
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn deserialize_from_item<T>(name: &str, item: &Item) -> anyhow::Result<T>
|
||||||
|
where
|
||||||
|
T: serde::de::DeserializeOwned,
|
||||||
|
{
|
||||||
|
// ValueDeserializer::new is not public, so use the ValueDeserializer's documented way
|
||||||
|
let deserializer = match item.clone().into_value() {
|
||||||
|
Ok(value) => value.into_deserializer(),
|
||||||
|
Err(item) => anyhow::bail!("toml_edit::Item '{item}' is not a toml_edit::Value"),
|
||||||
|
};
|
||||||
|
T::deserialize(deserializer).with_context(|| format!("deserializing item for node {name}"))
|
||||||
|
}
|
||||||
|
|
||||||
/// Configurable semaphore permits setting.
|
/// Configurable semaphore permits setting.
|
||||||
///
|
///
|
||||||
/// Does not allow semaphore permits to be zero, because at runtime initially zero permits and empty
|
/// Does not allow semaphore permits to be zero, because at runtime initially zero permits and empty
|
||||||
@@ -986,9 +1000,10 @@ mod tests {
|
|||||||
|
|
||||||
use remote_storage::{RemoteStorageKind, S3Config};
|
use remote_storage::{RemoteStorageKind, S3Config};
|
||||||
use tempfile::{tempdir, TempDir};
|
use tempfile::{tempdir, TempDir};
|
||||||
|
use utils::serde_percent::Percent;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::DEFAULT_PG_VERSION;
|
use crate::{tenant::config::EvictionPolicy, DEFAULT_PG_VERSION};
|
||||||
|
|
||||||
const ALL_BASE_VALUES_TOML: &str = r#"
|
const ALL_BASE_VALUES_TOML: &str = r#"
|
||||||
# Initial configuration file created by 'pageserver --init'
|
# Initial configuration file created by 'pageserver --init'
|
||||||
@@ -1286,6 +1301,71 @@ trace_read_requests = {trace_read_requests}"#,
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn eviction_pageserver_config_parse() -> anyhow::Result<()> {
|
||||||
|
let tempdir = tempdir()?;
|
||||||
|
let (workdir, pg_distrib_dir) = prepare_fs(&tempdir)?;
|
||||||
|
|
||||||
|
let pageserver_conf_toml = format!(
|
||||||
|
r#"pg_distrib_dir = "{}"
|
||||||
|
metric_collection_endpoint = "http://sample.url"
|
||||||
|
metric_collection_interval = "10min"
|
||||||
|
id = 222
|
||||||
|
|
||||||
|
[disk_usage_based_eviction]
|
||||||
|
max_usage_pct = 80
|
||||||
|
min_avail_bytes = 0
|
||||||
|
period = "10s"
|
||||||
|
|
||||||
|
[tenant_config]
|
||||||
|
evictions_low_residence_duration_metric_threshold = "20m"
|
||||||
|
|
||||||
|
[tenant_config.eviction_policy]
|
||||||
|
kind = "LayerAccessThreshold"
|
||||||
|
period = "20m"
|
||||||
|
threshold = "20m"
|
||||||
|
"#,
|
||||||
|
pg_distrib_dir.display(),
|
||||||
|
);
|
||||||
|
let toml: Document = pageserver_conf_toml.parse()?;
|
||||||
|
let conf = PageServerConf::parse_and_validate(&toml, &workdir)?;
|
||||||
|
|
||||||
|
assert_eq!(conf.pg_distrib_dir, pg_distrib_dir);
|
||||||
|
assert_eq!(
|
||||||
|
conf.metric_collection_endpoint,
|
||||||
|
Some("http://sample.url".parse().unwrap())
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
conf.metric_collection_interval,
|
||||||
|
Duration::from_secs(10 * 60)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
conf.default_tenant_conf
|
||||||
|
.evictions_low_residence_duration_metric_threshold,
|
||||||
|
Duration::from_secs(20 * 60)
|
||||||
|
);
|
||||||
|
assert_eq!(conf.id, NodeId(222));
|
||||||
|
assert_eq!(
|
||||||
|
conf.disk_usage_based_eviction,
|
||||||
|
Some(DiskUsageEvictionTaskConfig {
|
||||||
|
max_usage_pct: Percent::new(80).unwrap(),
|
||||||
|
min_avail_bytes: 0,
|
||||||
|
period: Duration::from_secs(10),
|
||||||
|
#[cfg(feature = "testing")]
|
||||||
|
mock_statvfs: None,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
match &conf.default_tenant_conf.eviction_policy {
|
||||||
|
EvictionPolicy::NoEviction => panic!("Unexpected eviction opolicy tenant settings"),
|
||||||
|
EvictionPolicy::LayerAccessThreshold(eviction_thresold) => {
|
||||||
|
assert_eq!(eviction_thresold.period, Duration::from_secs(20 * 60));
|
||||||
|
assert_eq!(eviction_thresold.threshold, Duration::from_secs(20 * 60));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn prepare_fs(tempdir: &TempDir) -> anyhow::Result<(PathBuf, PathBuf)> {
|
fn prepare_fs(tempdir: &TempDir) -> anyhow::Result<(PathBuf, PathBuf)> {
|
||||||
let tempdir_path = tempdir.path();
|
let tempdir_path = tempdir.path();
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ fn copyin_stream(pgb: &mut PostgresBackendTCP) -> impl Stream<Item = io::Result<
|
|||||||
|
|
||||||
_ = task_mgr::shutdown_watcher() => {
|
_ = task_mgr::shutdown_watcher() => {
|
||||||
// We were requested to shut down.
|
// We were requested to shut down.
|
||||||
let msg = format!("pageserver is shutting down");
|
let msg = "pageserver is shutting down".to_string();
|
||||||
let _ = pgb.write_message_noflush(&BeMessage::ErrorResponse(&msg, None));
|
let _ = pgb.write_message_noflush(&BeMessage::ErrorResponse(&msg, None));
|
||||||
Err(QueryError::Other(anyhow::anyhow!(msg)))
|
Err(QueryError::Other(anyhow::anyhow!(msg)))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1894,7 +1894,7 @@ impl Tenant {
|
|||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
// Convert the config to a toml file.
|
// Convert the config to a toml file.
|
||||||
conf_content += &toml_edit::easy::to_string(&tenant_conf)?;
|
conf_content += &toml_edit::ser::to_string(&tenant_conf)?;
|
||||||
|
|
||||||
let mut target_config_file = VirtualFile::open_with_options(
|
let mut target_config_file = VirtualFile::open_with_options(
|
||||||
target_config_path,
|
target_config_path,
|
||||||
|
|||||||
@@ -291,9 +291,9 @@ mod tests {
|
|||||||
..TenantConfOpt::default()
|
..TenantConfOpt::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
let toml_form = toml_edit::easy::to_string(&small_conf).unwrap();
|
let toml_form = toml_edit::ser::to_string(&small_conf).unwrap();
|
||||||
assert_eq!(toml_form, "gc_horizon = 42\n");
|
assert_eq!(toml_form, "gc_horizon = 42\n");
|
||||||
assert_eq!(small_conf, toml_edit::easy::from_str(&toml_form).unwrap());
|
assert_eq!(small_conf, toml_edit::de::from_str(&toml_form).unwrap());
|
||||||
|
|
||||||
let json_form = serde_json::to_string(&small_conf).unwrap();
|
let json_form = serde_json::to_string(&small_conf).unwrap();
|
||||||
assert_eq!(json_form, "{\"gc_horizon\":42}");
|
assert_eq!(json_form, "{\"gc_horizon\":42}");
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ pub(super) async fn upload_timeline_layer<'a>(
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
storage
|
storage
|
||||||
.upload(Box::new(source_file), fs_size, &storage_path, None)
|
.upload(source_file, fs_size, &storage_path, None)
|
||||||
.await
|
.await
|
||||||
.with_context(|| {
|
.with_context(|| {
|
||||||
format!(
|
format!(
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ use std::convert::Infallible;
|
|||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::task::Poll;
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tokio::sync::broadcast;
|
use tokio::sync::broadcast;
|
||||||
use tokio::sync::broadcast::error::RecvError;
|
use tokio::sync::broadcast::error::RecvError;
|
||||||
@@ -374,7 +373,7 @@ impl BrokerService for Broker {
|
|||||||
Ok(info) => yield info,
|
Ok(info) => yield info,
|
||||||
Err(RecvError::Lagged(skipped_msg)) => {
|
Err(RecvError::Lagged(skipped_msg)) => {
|
||||||
missed_msgs += skipped_msg;
|
missed_msgs += skipped_msg;
|
||||||
if let Poll::Ready(_) = futures::poll!(Box::pin(warn_interval.tick())) {
|
if (futures::poll!(Box::pin(warn_interval.tick()))).is_ready() {
|
||||||
warn!("subscription id={}, key={:?} addr={:?} dropped {} messages, channel is full",
|
warn!("subscription id={}, key={:?} addr={:?} dropped {} messages, channel is full",
|
||||||
subscriber.id, subscriber.key, subscriber.remote_addr, missed_msgs);
|
subscriber.id, subscriber.key, subscriber.remote_addr, missed_msgs);
|
||||||
missed_msgs = 0;
|
missed_msgs = 0;
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ version = "0.1.0"
|
|||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap.workspace = true
|
clap.workspace = true
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ byteorder = { version = "1" }
|
|||||||
bytes = { version = "1", features = ["serde"] }
|
bytes = { version = "1", features = ["serde"] }
|
||||||
chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] }
|
chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] }
|
||||||
clap = { version = "4", features = ["derive", "string"] }
|
clap = { version = "4", features = ["derive", "string"] }
|
||||||
|
clap_builder = { version = "4", default-features = false, features = ["color", "help", "std", "string", "suggestions", "usage"] }
|
||||||
crossbeam-utils = { version = "0.8" }
|
crossbeam-utils = { version = "0.8" }
|
||||||
digest = { version = "0.10", features = ["mac", "std"] }
|
digest = { version = "0.10", features = ["mac", "std"] }
|
||||||
either = { version = "1" }
|
either = { version = "1" }
|
||||||
@@ -29,7 +30,6 @@ futures-executor = { version = "0.3" }
|
|||||||
futures-sink = { version = "0.3" }
|
futures-sink = { version = "0.3" }
|
||||||
futures-util = { version = "0.3", features = ["channel", "io", "sink"] }
|
futures-util = { version = "0.3", features = ["channel", "io", "sink"] }
|
||||||
hashbrown = { version = "0.12", features = ["raw"] }
|
hashbrown = { version = "0.12", features = ["raw"] }
|
||||||
indexmap = { version = "1", default-features = false, features = ["std"] }
|
|
||||||
itertools = { version = "0.10" }
|
itertools = { version = "0.10" }
|
||||||
libc = { version = "0.2", features = ["extra_traits"] }
|
libc = { version = "0.2", features = ["extra_traits"] }
|
||||||
log = { version = "0.4", default-features = false, features = ["std"] }
|
log = { version = "0.4", default-features = false, features = ["std"] }
|
||||||
@@ -52,7 +52,8 @@ socket2 = { version = "0.4", default-features = false, features = ["all"] }
|
|||||||
tokio = { version = "1", features = ["fs", "io-std", "io-util", "macros", "net", "process", "rt-multi-thread", "signal", "sync", "time"] }
|
tokio = { version = "1", features = ["fs", "io-std", "io-util", "macros", "net", "process", "rt-multi-thread", "signal", "sync", "time"] }
|
||||||
tokio-rustls = { version = "0.23" }
|
tokio-rustls = { version = "0.23" }
|
||||||
tokio-util = { version = "0.7", features = ["codec", "io"] }
|
tokio-util = { version = "0.7", features = ["codec", "io"] }
|
||||||
tonic = { version = "0.8", features = ["tls-roots"] }
|
toml_datetime = { version = "0.6", default-features = false, features = ["serde"] }
|
||||||
|
toml_edit = { version = "0.19", features = ["serde"] }
|
||||||
tower = { version = "0.4", features = ["balance", "buffer", "limit", "retry", "timeout", "util"] }
|
tower = { version = "0.4", features = ["balance", "buffer", "limit", "retry", "timeout", "util"] }
|
||||||
tracing = { version = "0.1", features = ["log"] }
|
tracing = { version = "0.1", features = ["log"] }
|
||||||
tracing-core = { version = "0.1" }
|
tracing-core = { version = "0.1" }
|
||||||
@@ -64,7 +65,6 @@ anyhow = { version = "1", features = ["backtrace"] }
|
|||||||
bytes = { version = "1", features = ["serde"] }
|
bytes = { version = "1", features = ["serde"] }
|
||||||
either = { version = "1" }
|
either = { version = "1" }
|
||||||
hashbrown = { version = "0.12", features = ["raw"] }
|
hashbrown = { version = "0.12", features = ["raw"] }
|
||||||
indexmap = { version = "1", default-features = false, features = ["std"] }
|
|
||||||
itertools = { version = "0.10" }
|
itertools = { version = "0.10" }
|
||||||
libc = { version = "0.2", features = ["extra_traits"] }
|
libc = { version = "0.2", features = ["extra_traits"] }
|
||||||
log = { version = "0.4", default-features = false, features = ["std"] }
|
log = { version = "0.4", default-features = false, features = ["std"] }
|
||||||
@@ -74,6 +74,7 @@ prost = { version = "0.11" }
|
|||||||
regex = { version = "1" }
|
regex = { version = "1" }
|
||||||
regex-syntax = { version = "0.6" }
|
regex-syntax = { version = "0.6" }
|
||||||
serde = { version = "1", features = ["alloc", "derive"] }
|
serde = { version = "1", features = ["alloc", "derive"] }
|
||||||
syn = { version = "1", features = ["extra-traits", "full", "visit", "visit-mut"] }
|
syn-dff4ba8e3ae991db = { package = "syn", version = "1", features = ["extra-traits", "full", "visit", "visit-mut"] }
|
||||||
|
syn-f595c2ba2a3f28df = { package = "syn", version = "2", features = ["extra-traits", "full", "visit-mut"] }
|
||||||
|
|
||||||
### END HAKARI SECTION
|
### END HAKARI SECTION
|
||||||
|
|||||||
Reference in New Issue
Block a user