agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Validate publisher for retain_dead_tuples in the apply worker.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Validate publisher for retain_dead_tuples in the apply worker.
@ 2026-08-04 03:35 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Amit Kapila @ 2026-08-04 03:35 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Validate publisher for retain_dead_tuples in the apply worker.

Enabling retain_dead_tuples requires the publisher to run PostgreSQL 19 or
later and to not be in recovery. Previously this was checked only at DDL
time. That forced ALTER SUBSCRIPTION ... ENABLE to connect to the
publisher, so pg_upgrade (which re-enables subscriptions during restore)
failed if the publisher was unreachable. It was also not authoritative,
since the publisher's version or recovery status can change afterwards,
for example after a failover.

Perform the check authoritatively in the apply worker when it connects,
and stop doing it when enabling a subscription. ENABLE is the only command
issued during restore that triggered it, so this also fixes the pg_upgrade
failure. The DDL-time check is kept as a convenience for the other paths,
none of which are issued during restore.

Reported-by: Noah Misch <noah@leadboat.com>
Analyzed-by: Jeff Davis <pgsql@j-davis.com>
Author: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Jeff Davis <pgsql@j-davis.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Backpatch-through: 19, where it was introduced
Discussion: https://postgr.es/m/20260710195902.4f.noahmisch@microsoft.com

Branch
------
master

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

Modified Files
--------------
src/backend/commands/subscriptioncmds.c  | 22 +++++++++-------------
src/backend/replication/logical/worker.c | 15 +++++++++++++++
src/include/commands/subscriptioncmds.h  |  4 ++++
3 files changed, 28 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Validate publisher for retain_dead_tuples in the apply worker.
@ 2026-08-04 03:35 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Amit Kapila @ 2026-08-04 03:35 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Validate publisher for retain_dead_tuples in the apply worker.

Enabling retain_dead_tuples requires the publisher to run PostgreSQL 19 or
later and to not be in recovery. Previously this was checked only at DDL
time. That forced ALTER SUBSCRIPTION ... ENABLE to connect to the
publisher, so pg_upgrade (which re-enables subscriptions during restore)
failed if the publisher was unreachable. It was also not authoritative,
since the publisher's version or recovery status can change afterwards,
for example after a failover.

Perform the check authoritatively in the apply worker when it connects,
and stop doing it when enabling a subscription. ENABLE is the only command
issued during restore that triggered it, so this also fixes the pg_upgrade
failure. The DDL-time check is kept as a convenience for the other paths,
none of which are issued during restore.

Reported-by: Noah Misch <noah@leadboat.com>
Analyzed-by: Jeff Davis <pgsql@j-davis.com>
Author: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Jeff Davis <pgsql@j-davis.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Backpatch-through: 19, where it was introduced
Discussion: https://postgr.es/m/20260710195902.4f.noahmisch@microsoft.com

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/98bcb0ab8aa3c783adc27e677ab861a4a8baa411

Modified Files
--------------
src/backend/commands/subscriptioncmds.c  | 22 +++++++++-------------
src/backend/replication/logical/worker.c | 15 +++++++++++++++
src/include/commands/subscriptioncmds.h  |  4 ++++
3 files changed, 28 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-08-04 03:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-04 03:35 pgsql: Validate publisher for retain_dead_tuples in the apply worker. Amit Kapila <akapila@postgresql.org>
2026-08-04 03:35 pgsql: Validate publisher for retain_dead_tuples in the apply worker. Amit Kapila <akapila@postgresql.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox