From: | vignesh C <vignesh21(at)gmail(dot)com> |
---|---|
To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Euler Taveira <euler(at)eulerto(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org> |
Subject: | Re: Logical Replication of sequences |
Date: | 2025-09-05 09:16:20 |
Message-ID: | CALDaNm30iA_N4Dfeyp__YdLnbm9oatw_+VyCfNfbQmZiS_ybCw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, 5 Sept 2025 at 04:01, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Wed, Aug 20, 2025 at 4:57 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > On Mon, Aug 18, 2025 at 3:36 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > >
> > > Thanks for the comments, the updated version has the changes for the same.
> > >
> >
> > I wanted to first discuss a few design points. The patch implements
> > "ALTER SUBSCRIPTION ... REFRESH PUBLICATION SEQUENCES" such that it
> > copies the existing sequences values and also adds/removes any missing
> > sequences. For the second part (add/remove sequences), we already have
> > a separate command "ALTER SUBSCRIPTION ... REFRESH PUBLICATION". So, I
> > feel the new command should only copy the sequence values, as that
> > will keep the interface easy to define and understand. Additionally,
> > it will help to simplify the code in the patch, especially in the
> > function AlterSubscription_refresh.
>
> While I agree that the new command just copies the sequence values,
> I'm not sure the command should be implemented as an extension of
> ALTER SUBSCRIPTION ... REFRESH PUBLICATION command. Probably what the
> new command does is quite different from what REFRESH PUBLICATION
> command does?
Alternatively, the syntax options could be:
ALTER SUBSCRIPTION subname RESYNC PUBLICATION SEQUENCES;
or
ALTER SUBSCRIPTION subname RESYNC SEQUENCES;
Do you have a preference between the two?
> >
> > We previously discussed *not* to launch an apply worker if the
> > corresponding publication(s) only publish sequences. See [1]. We
> > should consider it again to see if that is a good idea. It will have
> > some drawbacks as compared to the current approach of doing sync via
> > sync worker. The command could take time for a large number of
> > sequences, and on failure, retry won't happen which can happen with
> > background workers. Additionally, when the connect option is false for
> > a subscription during creation, the user needs to later call REFRESH
> > to sync the sequences after enabling the subscription. OTOH, doing the
> > sync during the command will bring more predictability and simplify
> > the patch. What do others think?
>
> It seems okay to me that we launch an apply worker for a subscription
> corresponding to sequence-only publications. I think the situation
> seems somewhat similar to the case where we launch an apply worker
> even for a subscription corresponding to empty publications. It would
> be quite a rare case in practice where publications have only
> sequences.
I agree with this.
> I guess that it would rather simplify the patch if we can
> cut the part of doing the sync during the command (i.e., not
> distinguish between table-and-sequence publications and sequence-only
> publications), no?
Currently, we don’t make a distinction between the two. Just to
clarify, could you point me to the specific part of the patch you’re
referring to?
Regards,
Vignesh
From | Date | Subject | |
---|---|---|---|
Next Message | zengman | 2025-09-05 09:20:27 | Re: When deleting the plpgsql function, release the CachedPlan of the function |
Previous Message | Andrei Klychkov | 2025-09-05 09:08:15 | Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters |