diff --git a/storage_controller/src/compute_hook.rs b/storage_controller/src/compute_hook.rs index 9e4e528b16..232f8abbab 100644 --- a/storage_controller/src/compute_hook.rs +++ b/storage_controller/src/compute_hook.rs @@ -509,7 +509,11 @@ impl ApiMethod for ComputeHookTenant { if endpoint.tenant_id == *tenant_id && endpoint.status() == EndpointStatus::Running { tracing::info!("Reconfiguring pageservers for endpoint {endpoint_name}"); - let shard_count = ShardCount(shards.len().try_into().expect("too many shards")); + let shard_count = match shards.len() { + 0 => panic!("no shards"), + 1 => ShardCount::unsharded(), + n => ShardCount(n.try_into().expect("too many shards")), + }; let mut shard_infos: HashMap = HashMap::new(); @@ -556,7 +560,7 @@ impl ApiMethod for ComputeHookTenant { } let pageserver_conninfo = PageserverConnectionInfo { - shard_count: ShardCount::unsharded(), + shard_count, stripe_size: stripe_size.map(|val| val.0), shards: shard_infos, prefer_protocol,