Re: Remove an unused function GetWalRcvWriteRecPtr

From: Andres Freund <andres(at)anarazel(dot)de>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove an unused function GetWalRcvWriteRecPtr
Date: 2022-03-26 17:27:09
Message-ID: 20220326172709.cutc72m4xlh77vl4@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-03-26 17:39:17 Re: Remove an unused function GetWalRcvWriteRecPtr
Previous Message Tom Lane 2022-03-26 17:23:34 Re: Pointer subtraction with a null pointer