control_plane: improve debug of pageserver_connstr

This commit is contained in:
John Spray
2023-12-19 11:05:58 +00:00
parent 3ccf5abc9d
commit 6e56f88b79
4 changed files with 12 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ pub struct NodeRegisterRequest {
pub listen_http_port: u16,
}
#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Debug)]
pub struct TenantLocateResponseShard {
pub shard_id: TenantShardId,
pub node_id: NodeId,

View File

@@ -737,6 +737,15 @@ async fn handle_tenant_locate(req: Request<Body>) -> Result<Response<Body>, ApiE
));
}
let shard_params = shard_params.expect("result is non-empty, therefore this is set");
tracing::info!(
"Located tenant {} on shards {}",
tenant_id,
result
.iter()
.map(|s| format!("{:?}", s))
.collect::<Vec<_>>()
.join(",")
);
json_response(
StatusCode::OK,

View File

@@ -921,6 +921,7 @@ async fn handle_endpoint(ep_match: &ArgMatches, env: &local_env::LocalEnv) -> Re
)
})
.collect::<Vec<_>>();
assert!(!pageservers.is_empty());
let stripe_size = locate_result.shard_params.stripe_size.map(|s| s.0 as usize);
let ps_conf = env.get_pageserver_conf(pageserver_id)?;

View File

@@ -481,6 +481,7 @@ impl Endpoint {
}
let pageserver_connstring = Self::build_pageserver_connstr(&pageservers);
assert!(!pageserver_connstring.is_empty());
let mut safekeeper_connstrings = Vec::new();
if self.mode == ComputeMode::Primary {