Re: define PG_REPLSLOT_DIR

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: define PG_REPLSLOT_DIR
Date: 2024-08-20 05:40:46
Message-ID: CAExHW5tqkJrj2MviEi98qrVsZWbvUc-88u7qC_nx7hmO=qnrsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 20, 2024 at 10:49 AM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Tue, Aug 20, 2024 at 09:26:59AM +0530, Ashutosh Bapat wrote:
> > On Mon, Aug 19, 2024 at 7:47 PM Bertrand Drouvot
> > <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
> > >
> > > Hi,
> > >
> > > On Mon, Aug 19, 2024 at 04:11:31PM +0530, Ashutosh Bapat wrote:
> > > > On Wed, Aug 14, 2024 at 5:02 PM Bertrand Drouvot
> > > > <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
> > > > >
> > > > > Hi hackers,
> > > > >
> > > > > while working on a replication slot tool (idea is to put it in contrib, not
> > > > > shared yet), I realized that "pg_replslot" is being used > 25 times in
> > > > > .c files.
> > > > >
> > > > > I think it would make sense to replace those occurrences with a $SUBJECT, attached
> > > > > a patch doing so.
> > > >
> > > > Many of these places are slot specific directory/file names within
> > > > pg_replslot. I think we can further improve the code by creating macro
> > > > on the lines of LSN_FORMAT_ARGS
> > > > #define SLOT_DIRNAME_ARGS(slotname) (PG_REPLSLOT_DIR, slotname)
> > > > this way we "codify" method to construct the slot directory name
> > > > everywhere.
> > >
> > > Thanks for the feedback!
> > >
> > > I think that could make sense. As the already proposed mechanical changes are
> > > error prone (from my point of view), I would suggest to have a look at your
> > > proposal once the proposed changes go in.
> >
> > What do you mean by error prone?
>
> I meant to say that it is "easy" to make mistakes when doing those manual
> mechanical changes. Also I think it's not that fun/easy to review, that's why
> I think it's better to do one change at a time. Does that make sense to you?

Since these are all related changes, doing them at once might make it
faster. You may use multiple commits (one for each change) to
"contain" errors.

--
Best Wishes,
Ashutosh Bapat

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Harris 2024-08-20 05:52:12 ANALYZE ONLY
Previous Message Bertrand Drouvot 2024-08-20 05:19:56 Re: define PG_REPLSLOT_DIR