From e0ee6fbeffac246b240ed3e4ec9082773edc7a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Mon, 14 Apr 2025 12:36:40 +0200 Subject: [PATCH] Remove deprecated --compute-hook-url storcon param (#11551) We have already migrated the storage controller to `--control-plane-url`, added in #11173. The new param was added to support also safekeeper specific endpoints. See the docs changes in #11195 for further details. Part of #11163 --- storage_controller/src/compute_hook.rs | 16 +++++++--------- storage_controller/src/main.rs | 11 ++--------- storage_controller/src/service.rs | 8 -------- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/storage_controller/src/compute_hook.rs b/storage_controller/src/compute_hook.rs index 2311cadb36..57709302e1 100644 --- a/storage_controller/src/compute_hook.rs +++ b/storage_controller/src/compute_hook.rs @@ -629,15 +629,13 @@ impl ComputeHook { }; let result = if !self.config.use_local_compute_notifications { - let compute_hook_url = if let Some(control_plane_url) = &self.config.control_plane_url { - Some(if control_plane_url.ends_with('/') { - format!("{control_plane_url}notify-attach") - } else { - format!("{control_plane_url}/notify-attach") - }) - } else { - self.config.compute_hook_url.clone() - }; + let compute_hook_url = + self.config + .control_plane_url + .as_ref() + .map(|control_plane_url| { + format!("{}/notify-attach", control_plane_url.trim_end_matches('/')) + }); // We validate this at startup let notify_url = compute_hook_url.as_ref().unwrap(); diff --git a/storage_controller/src/main.rs b/storage_controller/src/main.rs index 9358c9da4d..a924e5b6c5 100644 --- a/storage_controller/src/main.rs +++ b/storage_controller/src/main.rs @@ -86,10 +86,6 @@ struct Cli { #[arg(long)] peer_jwt_token: Option, - /// URL to control plane compute notification endpoint - #[arg(long)] - compute_hook_url: Option, - /// URL to control plane storage API prefix #[arg(long)] control_plane_url: Option, @@ -360,13 +356,11 @@ async fn async_main() -> anyhow::Result<()> { "Insecure config! One or more secrets is not set. This is only permitted in `--dev` mode" ); } - StrictMode::Strict - if args.compute_hook_url.is_none() && args.control_plane_url.is_none() => - { + StrictMode::Strict if args.control_plane_url.is_none() => { // Production systems should always have a control plane URL set, to prevent falling // back to trying to use neon_local. anyhow::bail!( - "neither `--compute-hook-url` nor `--control-plane-url` are set: this is only permitted in `--dev` mode" + "`--control-plane-url` is not set: this is only permitted in `--dev` mode" ); } StrictMode::Strict if args.use_local_compute_notifications => { @@ -394,7 +388,6 @@ async fn async_main() -> anyhow::Result<()> { safekeeper_jwt_token: secrets.safekeeper_jwt_token, control_plane_jwt_token: secrets.control_plane_jwt_token, peer_jwt_token: secrets.peer_jwt_token, - compute_hook_url: args.compute_hook_url, control_plane_url: args.control_plane_url, max_offline_interval: args .max_offline_interval diff --git a/storage_controller/src/service.rs b/storage_controller/src/service.rs index 0982e56155..a021313474 100644 --- a/storage_controller/src/service.rs +++ b/storage_controller/src/service.rs @@ -357,18 +357,10 @@ pub struct Config { // This JWT token will be used to authenticate with other storage controller instances pub peer_jwt_token: Option, - /// Where the compute hook should send notifications of pageserver attachment locations - /// (this URL points to the control plane in prod). If this is None, the compute hook will - /// assume it is running in a test environment and try to update neon_local. - pub compute_hook_url: Option, - /// Prefix for storage API endpoints of the control plane. We use this prefix to compute /// URLs that we use to send pageserver and safekeeper attachment locations. /// If this is None, the compute hook will assume it is running in a test environment /// and try to invoke neon_local instead. - /// - /// For now, there is also `compute_hook_url` which allows configuration of the pageserver - /// specific endpoint, but it is in the process of being phased out. pub control_plane_url: Option, /// Grace period within which a pageserver does not respond to heartbeats, but is still