diff --git a/Cargo.lock b/Cargo.lock index b7616a4ba4..6baa13f057 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2667,9 +2667,9 @@ dependencies = [ [[package]] name = "linkerd2-proxy-api" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba9e3b341ca4992feaf43a4d2bdbfe2081aa3e2b9a503753544ce55242af6342" +checksum = "de4e1c9b974df0a6c27e436310aecdbe6686ee911100deb44ac6343e206a9f0c" dependencies = [ "h2", "http", diff --git a/Cargo.toml b/Cargo.toml index 7ac6863ca9..adf5a37b6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -134,7 +134,7 @@ default-features = false features = ["tokio", "tracing"] [workspace.dependencies.linkerd2-proxy-api] -version = "0.18.0" +version = "0.20.0" [workspace.dependencies.rand] version = "0.9" diff --git a/linkerd/exp-backoff/src/lib.rs b/linkerd/exp-backoff/src/lib.rs index 08ea9d26d3..9bea70e165 100644 --- a/linkerd/exp-backoff/src/lib.rs +++ b/linkerd/exp-backoff/src/lib.rs @@ -11,6 +11,8 @@ use thiserror::Error; use tokio::time; /// A jittered exponential backoff strategy. +// +// TODO(kate): add respect_retry_after_hint field here. #[derive(Copy, Clone, Debug, Default)] pub struct ExponentialBackoff { /// The minimum amount of time to wait before resuming an operation. @@ -52,6 +54,7 @@ impl ExponentialBackoff { min: time::Duration, max: time::Duration, jitter: f64, + // TODO(kate): add respect_retry_after_hint parameter here. ) -> Result { if min > max { return Err(InvalidBackoff("maximum must not be less than minimum")); diff --git a/linkerd/proxy/client-policy/src/lib.rs b/linkerd/proxy/client-policy/src/lib.rs index 4a51b3a1d3..ab50e146b1 100644 --- a/linkerd/proxy/client-policy/src/lib.rs +++ b/linkerd/proxy/client-policy/src/lib.rs @@ -103,6 +103,7 @@ pub enum BackendDispatcher { Forward(SocketAddr, Arc), BalanceP2c(Load, EndpointDiscovery), Fail { message: Arc }, + // TODO(kate): add a `PenaltyPeakEwma` variant here. } #[derive(Clone, Debug, Eq, Hash, PartialEq)] @@ -135,6 +136,7 @@ pub enum FailureAccrual { /// Backoff for probing the endpoint when it is in a failed state. backoff: linkerd_exp_backoff::ExponentialBackoff, }, + // TODO(kate): add a `Unified` variant here. } // === impl ClientPolicy === @@ -394,6 +396,9 @@ pub mod proto { #[error("invalid backend metadata: {0}")] Meta(#[from] InvalidMeta), + + #[error("penalty peak ewma mode is not yet supported")] + PenaltyPeakEwmaUnsupported, } #[derive(Debug, thiserror::Error)] @@ -423,6 +428,8 @@ pub mod proto { Backoff(#[from] InvalidBackoff), #[error("missing {0}")] Missing(&'static str), + #[error("unified failure accrual is not yet supported")] + UnifiedUnsupported, } #[derive(Debug, thiserror::Error)] @@ -667,6 +674,10 @@ pub mod proto { default_rtt: duration("peak EWMA default RTT", default_rtt)?, decay: duration("peak EWMA decay", decay)?, }), + balance_p2c::Load::PenaltyPeakEwma(_) => { + // TODO(kate): marshal `PenaltyPeakEwma` here. + return Err(InvalidBackend::PenaltyPeakEwmaUnsupported); + } }; BackendDispatcher::BalanceP2c(load, discovery) } @@ -733,6 +744,8 @@ pub mod proto { InvalidFailureAccrual::Missing("consecutive failures backoff"), )?, }), + // TODO(kate): marshal `Unified` here. + failure_accrual::Kind::Unified(_) => Err(InvalidFailureAccrual::UnifiedUnsupported), } } } @@ -751,6 +764,7 @@ pub mod proto { min_backoff, max_backoff, jitter_ratio, + respect_retry_after_hint: _, // TODO(kate): use respect_retry_after_hint }: outbound::ExponentialBackoff, ) -> Result { let min = min_backoff