Re: Add into REFRESH PUBLICATION parameter exception_behaviour

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Andrei Lepikhov <lepihov(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add into REFRESH PUBLICATION parameter exception_behaviour
Date: 2026-02-20 05:45:41
Message-ID: CAA4eK1Jgw9b58O-NjH7OFxmh6c_8zR1Vws32T_OS_ZKVjV2GBQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 19, 2026 at 1:37 PM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
>
> On 19/2/26 07:44, Amit Kapila wrote:
> > On Tue, Feb 17, 2026 at 1:39 PM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
> >> ...
> >> I only proposed that if the REFRESH PUBLICATION that re-introduced such
> >> a table fails, complain and remove it from the subscription, as if you
> >> had never executed the 'REFRESH PUBLICATION' command. Where is the
> >> inconsistency?
> > ...
> > In such a situation, say when REFRESH command is executed and table
> > sync for t1_fk failed and we mark that table status as FAILED, then
> > the future replication will perform operations only on t_pk table even
> > though the same transaction has delete on both t1_pk and t_fk tables.
> > This is because we don't apply operations on a table for which initial
> > sync is not finished yet which will be true for t_fk.
> Thank you for clarifying.
>
> A proper 'soft' exception should revert all changes made by REFRESH
> PUBLICATION on the subscriber's side. However, AlterSubscription_refresh
> updates and commits the publication's state in pg_catalog before
> synchronisation begins in the apply worker. Implementing a full revert
> would require significant redesign and may be more appropriate for
> enterprise solutions seeking this level of functionality.
>

Right, and additional challenge would be to track all the background
work (both by apply and successful tablesync workers) that would have
happened. I guess the scenarios you are worried about can probably be
handled by conflict/resolution work.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2026-02-20 05:47:26 Re: Return pg_control from pg_backup_stop().
Previous Message David Steele 2026-02-20 05:41:59 Improve checks for GUC recovery_target_xid