agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix issues in logical replication sequence synchronization.
Date: Mon, 27 Jul 2026 03:45:19 +0000
Message-ID: <E1woCHH-00000000T5i-1Hos@gemulon.postgresql.org> (raw)

Fix issues in logical replication sequence synchronization.

1. Stop a running sequence synchronization worker when
ALTER SUBSCRIPTION ... DISABLE is executed.  The worker did not reread its
subscription after starting a transaction, so it kept running with a stale
copy and missed the disable. It now calls maybe_reread_subscription()
after StartTransactionCommand(), matching the apply worker.

2. Restore the invariant that publisher-side synchronization slots are
dropped last during ALTER SUBSCRIPTION ... REFRESH PUBLICATION.  The
slot-drop loop now runs after the sequence-removal loop, so the
non-transactional slot drops happen only after all catalog changes that
could still be rolled back on error.

3. Restore psql tab completion for
ALTER SUBSCRIPTION ... REFRESH PUBLICATION WITH (.

4. Make pg_stat_subscription report NULL for the fields that do not apply
to a sequence synchronization worker, which does not stream from a
walsender, and update the documentation accordingly.

5. Update the pg_subscription_rel.srsublsn catalog documentation to
describe its semantics for sequence rows.

Reported-by: Noah Misch <noah@leadboat.com>
Author: vignesh C <vignesh21@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 19, where it was introduced
Discussion: https://postgr.es/m/20260710045217.f0.noahmisch@microsoft.com

Branch
------
REL_19_STABLE

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

Modified Files
--------------
doc/src/sgml/catalogs.sgml                     |  6 ++-
doc/src/sgml/monitoring.sgml                   | 19 +++++----
src/backend/commands/subscriptioncmds.c        | 56 +++++++++++++-------------
src/backend/replication/logical/sequencesync.c |  2 +
src/backend/replication/logical/worker.c       | 14 ++++++-
src/bin/psql/tab-complete.in.c                 |  3 ++
6 files changed, 61 insertions(+), 39 deletions(-)



view thread (2+ messages)

Message-ID: <E1woCHH-00000000T5i-1Hos@gemulon.postgresql.org>
Permalink:  ../E1woCHH-00000000T5i-1Hos@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1woCHH-00000000T5i-1Hos@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix issues in logical replication sequence synchronization.
  In-Reply-To: <E1woCHH-00000000T5i-1Hos@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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