v2-0001-Make-GUC-wal_receiver_timeout-user-settable.patch

text/plain

Filename: v2-0001-Make-GUC-wal_receiver_timeout-user-settable.patch
Type: text/plain
Part: 0
Message: Re: Make wal_receiver_timeout configurable per subscription

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v2-0001
Subject: Make GUC wal_receiver_timeout user-settable.
File+
doc/src/sgml/config.sgml 0 3
src/backend/utils/misc/guc_tables.c 1 1
From d1559feb2f7b9493309e7630de93ef9b8f1bb03c Mon Sep 17 00:00:00 2001
From: Fujii Masao <fujii@postgresql.org>
Date: Mon, 26 May 2025 20:00:40 +0900
Subject: [PATCH v2 1/2] 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.
---
 doc/src/sgml/config.sgml            | 3 ---
 src/backend/utils/misc/guc_tables.c | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index c7acc0f182f..99f5444b092 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -5151,9 +5151,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>
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index d14b1678e7f..cf2d09b8fb3 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -2308,7 +2308,7 @@ struct config_int ConfigureNamesInt[] =
 	},
 
 	{
-		{"wal_receiver_timeout", PGC_SIGHUP, REPLICATION_STANDBY,
+		{"wal_receiver_timeout", PGC_USERSET, REPLICATION_STANDBY,
 			gettext_noop("Sets the maximum wait time to receive data from the sending server."),
 			gettext_noop("0 disables the timeout."),
 			GUC_UNIT_MS
-- 
2.49.0