Make GUC wal_receiver_timeout user-settable.

When multiple subscribers connect to different publisher servers,
it can be useful to set different wal_receiver_timeout values for
each connection to better detect failures. However, previously
this wasn't possible, which limited flexibility in managing subscriptions.

This commit changes wal_receiver_timeout to be user-settable,
allowing different values to be assigned using ALTER ROLE SET for
each subscription owner. This effectively enables per-subscription
configuration.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/a1414b64-bf58-43a6-8494-9704975a41e9@oss.nttdata.com
This commit is contained in:
Fujii Masao 2026-02-20 00:52:43 +09:00
parent 5b93a5987b
commit 8a6af3ad08
2 changed files with 1 additions and 4 deletions

View file

@ -5249,9 +5249,6 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
If this value is specified without units, it is taken as milliseconds.
The default value is 60 seconds.
A value of zero disables the timeout mechanism.
This parameter can only be set in
the <filename>postgresql.conf</filename> file or on the server
command line.
</para>
</listitem>
</varlistentry>

View file

@ -3413,7 +3413,7 @@
max => 'INT_MAX / 1000',
},
{ name => 'wal_receiver_timeout', type => 'int', context => 'PGC_SIGHUP', group => 'REPLICATION_STANDBY',
{ name => 'wal_receiver_timeout', type => 'int', context => 'PGC_USERSET', group => 'REPLICATION_STANDBY',
short_desc => 'Sets the maximum wait time to receive data from the sending server.',
long_desc => '0 disables the timeout.',
flags => 'GUC_UNIT_MS',