Re: Use XLogFromFileName() in pg_resetwal to parse position from WAL file

Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>

From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2022-10-04T06:22:23Z
Lists: pgsql-hackers
On Tue, Oct 4, 2022 at 11:47 AM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> > -     segs_per_xlogid = (UINT64CONST(0x0000000100000000) / ControlFile.xlog_seg_size);
> >       newXlogSegNo = ControlFile.checkPointCopy.redo / ControlFile.xlog_seg_size;
>
> Couldn't we use XLByteToSeg() here?

Yes, we could.

> Other than that, it looks good to me.

Thanks. There are a few more assorted WAL file related things I found,
I will be sending all of them in this thread itself in a while.

-- 
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



Commits

  1. Use macros from xlog_internal.h for WAL segment logic in pg_resetwal

  2. Make WAL segment size configurable at initdb time.