From b4808a4e5ccef3ea8c3f5fea16861eb0279e8671 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 31 Jul 2025 14:24:38 +0300 Subject: [PATCH] Set `neon.use_communicator_worker` GUC based on `prefer_protocol` --- compute_tools/src/config.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/compute_tools/src/config.rs b/compute_tools/src/config.rs index 7bb535083e..adc8496cea 100644 --- a/compute_tools/src/config.rs +++ b/compute_tools/src/config.rs @@ -8,7 +8,7 @@ use std::path::Path; use compute_api::responses::TlsConfig; use compute_api::spec::{ - ComputeAudit, ComputeMode, ComputeSpec, DatabricksSettings, GenericOption, + ComputeAudit, ComputeMode, ComputeSpec, DatabricksSettings, GenericOption, PageserverProtocol, }; use crate::compute::ComputeNodeParams; @@ -69,6 +69,15 @@ pub fn write_postgres_conf( writeln!(file, "# Neon storage settings")?; writeln!(file)?; if let Some(conninfo) = &spec.pageserver_connection_info { + match conninfo.prefer_protocol { + PageserverProtocol::Libpq => { + writeln!(file, "neon.use_communicator_worker=false")?; + } + PageserverProtocol::Grpc => { + writeln!(file, "neon.use_communicator_worker=true")?; + } + } + // Stripe size GUC should be defined prior to connection string if let Some(stripe_size) = conninfo.stripe_size { writeln!( @@ -148,6 +157,8 @@ pub fn write_postgres_conf( writeln!(file, "# no neon.pageserver_grpc_urls")?; } } else { + writeln!(file, "neon.use_communicator_worker=false")?; + // Stripe size GUC should be defined prior to connection string if let Some(stripe_size) = spec.shard_stripe_size { writeln!(file, "# from compute spec's shard_stripe_size field")?;