Re: pg_walinspect: ReadNextXLogRecord's first_record argument - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: pg_walinspect: ReadNextXLogRecord's first_record argument
Date
Msg-id CALj2ACWWUYmgvKioBVTFy4tdjrDjDm3qmeGaG1hF0J+MP+atGg@mail.gmail.com
Whole thread Raw
In response to Re: pg_walinspect: ReadNextXLogRecord's first_record argument  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pg_walinspect: ReadNextXLogRecord's first_record argument
List pgsql-hackers
On Wed, Aug 17, 2022 at 8:52 PM Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Wed, Aug 17, 2022 at 12:41 AM Bharath Rupireddy
> <bharath.rupireddyforpostgres@gmail.com> wrote:
> > Agreed.
> >
> > Here's a patch (for V15 as well) fixing this bug, please review.
>
> Couldn't you simplify this further by removing the lsn argument from
> GetWALRecordInfo and using record->ReadRecPtr instead? Then
> InitXLogReaderState's second argument could be XLogRecPtr instead of
> XLogRecPtr *.

Done. XLogFindNextRecord() stores the first valid record in EndRecPtr
and the ReadRecPtr is set to InvalidXLogRecPtr by calling
XLogBeginRead(). And XLogNextRecord() sets ReadRecPtr which we can
use.

PSA v2 patches.

-- 
Bharath Rupireddy
RDS Open Source Databases: https://aws.amazon.com/rds/postgresql/

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_walinspect: ReadNextXLogRecord's first_record argument
Next
From: Julien Rouhaud
Date:
Subject: Re: ICU for global collation