pgsql: Honor GUC settings specified in CREATE SUBSCRIPTION CONNECTION. - Mailing list pgsql-committers

From Fujii Masao
Subject pgsql: Honor GUC settings specified in CREATE SUBSCRIPTION CONNECTION.
Date
Msg-id E1vcxHm-004lJT-0g@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Honor GUC settings specified in CREATE SUBSCRIPTION CONNECTION.

Prior to v15, GUC settings supplied in the CONNECTION clause of
CREATE SUBSCRIPTION were correctly passed through to
the publisher's walsender. For example:

        CREATE SUBSCRIPTION mysub
            CONNECTION 'options=''-c wal_sender_timeout=1000'''
            PUBLICATION ...

would cause wal_sender_timeout to take effect on the publisher's walsender.

However, commit f3d4019da5d changed the way logical replication
connections are established, forcing the publisher's relevant
GUC settings (datestyle, intervalstyle, extra_float_digits) to
override those provided in the CONNECTION string. As a result,
from v15 through v18, GUC settings in the CONNECTION string were
always ignored.

This regression prevented per-connection tuning of logical replication.
For example, using a shorter timeout for walsender connecting
to a nearby subscriber and a longer one for walsender connecting
to a remote subscriber.

This commit restores the intended behavior by ensuring that
GUC settings in the CONNECTION string are again passed through
and applied by the walsender, allowing per-connection configuration.

Backpatch to v15, where the regression was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <lic@highgo.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Discussion: https://postgr.es/m/CAHGQGwGYV+-abbKwdrM2UHUe-JYOFWmsrs6=QicyJO-j+-Widw@mail.gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d926462d8190a81cc1f39c7fce65055f329e9419

Modified Files
--------------
.../libpqwalreceiver/libpqwalreceiver.c            | 43 +++++++++++++++++-----
1 file changed, 34 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: David Rowley
Date:
Subject: pgsql: Simplify GetOperatorFromCompareType() code
Next
From: Fujii Masao
Date:
Subject: pgsql: Add TAP test for GUC settings passed via CONNECTION in logical r