Re: Supporting TCP_SYNCNT in libpq - Mailing list pgsql-hackers

From Gabriele Bartolini
Subject Re: Supporting TCP_SYNCNT in libpq
Date
Msg-id CA+VUV5rZp8ZzCEAMUvU_v1HXkZjpCxHZTHJTBnj=TrtJXpNhmQ@mail.gmail.com
Whole thread Raw
In response to Supporting TCP_SYNCNT in libpq  (Francesco Canovai <francesco.canovai@enterprisedb.com>)
List pgsql-hackers
Ciao Francesco,

On Mon, 17 Mar 2025 at 09:19, Francesco Canovai <francesco.canovai@enterprisedb.com> wrote:
This patch introduces support for a `tcp_syn_count` parameter in
libpq, allowing control over the number of SYN retransmissions when
initiating a connection.

The primary goal is to prevent the walreceiver from getting stuck
resending SYNs for an extended period, up to
`net.ipv4.tcp_syn_retries` (127 seconds by default), in the event of
network disruptions.

Thanks for bringing this up and providing this straightforward patch. Configuring this TCP setting on the WAL receiver side will give us more precise control over connections, specifically over replication behaviour. This is especially important in Kubernetes environments with operators like CloudNativePG, where modifying this setting at a lower level may not be feasible due to separation of duties and permission constraints.

Ciao,
Gabriele
--
Gabriele Bartolini
VP, Chief Architect, Kubernetes

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: AIO v2.5
Next
From: Álvaro Herrera
Date:
Subject: Re: pg_stat_statements and "IN" conditions