From c19625a29ccd3b1433c0351b2146eafe410be129 Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Fri, 16 Feb 2024 16:50:09 +0200 Subject: [PATCH] Support sharding for compute_ctl (#6787) ## Problem See https://github.com/neondatabase/neon/issues/6786 ## Summary of changes Split connection string in compute.rs when requesting basebackup --- compute_tools/src/compute.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compute_tools/src/compute.rs b/compute_tools/src/compute.rs index 83db8e09ec..1c5363d048 100644 --- a/compute_tools/src/compute.rs +++ b/compute_tools/src/compute.rs @@ -324,7 +324,8 @@ impl ComputeNode { let spec = compute_state.pspec.as_ref().expect("spec must be set"); let start_time = Instant::now(); - let mut config = postgres::Config::from_str(&spec.pageserver_connstr)?; + let shard0_connstr = spec.pageserver_connstr.split(',').next().unwrap(); + let mut config = postgres::Config::from_str(shard0_connstr)?; // Use the storage auth token from the config file, if given. // Note: this overrides any password set in the connection string.