Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

From: Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, "Wei Wang (Fujitsu)" <wangw(dot)fnst(at)fujitsu(dot)com>, "Yu Shi (Fujitsu)" <shiy(dot)fnst(at)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication
Date: 2023-07-21 09:47:46
Message-ID: CAGPVpCTAm8bJMswY1kOHxHyB8-RZMTuB9W7fZSpfUZ7_C=bAUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, 21 Tem 2023 Cum, 08:39 tarihinde
şunu yazdı:

> On Fri, Jul 21, 2023 at 7:30 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> How about SetupLogRepWorker? The other thing I noticed is that we
> don't seem to be consistent in naming functions in these files. For
> example, shall we make all exposed functions follow camel case (like
> InitializeLogRepWorker) and static functions follow _ style (like
> run_apply_worker) or the other possibility is to use _ style for all
> functions except may be the entry functions like ApplyWorkerMain()? I
> don't know if there is already a pattern but if not then let's form it
> now, so that code looks consistent.
>

I agree that these files have inconsistencies in naming things.
Most of the time I can't really figure out which naming convention I should
use. I try to name things by looking at other functions with similar
responsibilities.

> 3.
> > extern void pa_xact_finish(ParallelApplyWorkerInfo *winfo,
> > XLogRecPtr remote_lsn);
> > +extern void set_stream_options(WalRcvStreamOptions *options,
> > + char *slotname,
> > + XLogRecPtr *origin_startpos);
> > +
> > +extern void start_apply(XLogRecPtr origin_startpos);
> > +extern void DisableSubscriptionAndExit(void);
> > +extern void StartLogRepWorker(int worker_slot);
> >
> > This placement (esp. with the missing whitespace) seems to be grouping
> > the set_stream_options with the other 'pa' externs, which are all
> > under the comment "/* Parallel apply worker setup and interactions
> > */".
> >
> > Putting all these up near the other "extern void
> > InitializeLogRepWorker(void)" might be less ambiguous.
> >
>
> +1. Also, note that they should be in the same order as they are in .c
> files.
>

I did not realize the order is the same with .c files. Good to know. I'll
fix it along with other comments.

Thanks,
--
Melih Mutlu
Microsoft

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2023-07-21 09:48:07 Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication
Previous Message Hayato Kuroda (Fujitsu) 2023-07-21 07:30:14 RE: [PoC] pg_upgrade: allow to upgrade publisher node