Re: Remove an unused function GetWalRcvWriteRecPtr - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Remove an unused function GetWalRcvWriteRecPtr
Date
Msg-id 20220326172709.cutc72m4xlh77vl4@alap3.anarazel.de
Whole thread Raw
In response to Remove an unused function GetWalRcvWriteRecPtr  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Remove an unused function GetWalRcvWriteRecPtr  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
Hi,

On 2022-03-26 10:51:15 +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).

-1. I think it's a perfectly reasonable function to have, it doesn't cause
architectural / maintenance issues to have it and there's several plausible
future uses for it (moving fsyncing of received WAL to different process,
optionally allowing logical decoding up to the written LSN, reporting function
for monitoring on the standby itself).

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Pointer subtraction with a null pointer
Next
From: Bharath Rupireddy
Date:
Subject: Re: Remove an unused function GetWalRcvWriteRecPtr