Re: Remove an unused function GetWalRcvWriteRecPtr

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove an unused function GetWalRcvWriteRecPtr
Date: 2022-03-26 14:10:41
Message-ID: CALj2ACUvUZGQ=xDKy_9b9GjKVnBjyuj90m=BdGyNOhGb5h7yEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 26, 2022 at 12:55 PM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:
>
> On Sat, Mar 26, 2022 at 02:52:29PM +0900, Michael Paquier wrote:
> > On Sat, Mar 26, 2022 at 10:51:15AM +0530, Bharath Rupireddy wrote:
> > > The function GetWalRcvWriteRecPtr isn't being used anywhere, however
> > > pg_atomic_read_u64(&walrcv->writtenUpto); (reading writtenUpto without
> > > spinlock) is being used directly in pg_stat_get_wal_receiver
> > > walreceiver.c. We either make use of the function instead of
> > > pg_atomic_read_u64(&walrcv->writtenUpto); or remove it. Since there's
> > > only one function using walrcv->writtenUpto right now, I prefer to
> > > remove the function to save some LOC (13).
> > >
> > > Attaching patch. Thoughts?
> >
> > This could be used by some external module, no?
>
> Maybe, but WalRcv is exposed so if an external module needs it it could still
> maintain its own version of GetWalRcvWriteRecPtr.

Yes. And the core extensions aren't using GetWalRcvWriteRecPtr. IMO,
let's not maintain that function.

Regards,
Bharath Rupireddy.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-03-26 14:16:29 Re: pg_relation_size on partitioned table
Previous Message vignesh C 2022-03-26 14:07:26 Re: Skipping schema changes in publication