pgsql: Fix synchronized_standby_slots GUC check hook - Mailing list pgsql-committers

From Álvaro Herrera
Subject pgsql: Fix synchronized_standby_slots GUC check hook
Date
Msg-id E1tIW7h-000vvf-3h@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix synchronized_standby_slots GUC check hook

The validate_sync_standby_slots subroutine requires an LWLock, so it
cannot run in processes without PGPROC; skip it there to avoid a crash.

This replaces the current test for ReplicationSlotCtl being not null,
which appears to be a solution for the same problem but less general.
I also rewrote a related comment that mentioned ReplicationSlotCtl in
StandbySlotsHaveCaughtup.

This code came in with commit bf279ddd1c28; backpatch to 17.

Reported-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Zhijie Hou <houzj.fnst@fujitsu.com>
Discussion: https://postgr.es/m/202411281216.sutbxtr6idnn@alvherre.pgsql

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9abdc1841e16ff4eaf2fa8e2e0472ee71a4a5a5c

Modified Files
--------------
src/backend/replication/slot.c | 44 ++++++++++++++++--------------------------
1 file changed, 17 insertions(+), 27 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque
Next
From: Tom Lane
Date:
Subject: pgsql: Define _POSIX_C_SOURCE as 200112L on Solaris.