Remove an unused function GetWalRcvWriteRecPtr

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Remove an unused function GetWalRcvWriteRecPtr
Date: 2022-03-26 05:21:15
Message-ID: CALj2ACXghpoFryfk7-=-gdBa9pVMtJ3gokeWisdmD44nGTWw1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

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?

Regards,
Bharath Rupireddy.

Attachment Content-Type Size
v1-0001-Remove-an-unused-function-GetWalRcvWriteRecPtr.patch application/octet-stream 1.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-03-26 05:33:46 Re: pg_tablespace_location() failure with allow_in_place_tablespaces
Previous Message Bharath Rupireddy 2022-03-26 05:01:01 Re: pg_walinspect - a new extension to get raw WAL data and WAL stats