Remove an unnecessary LSN calculation while validating WAL page header - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Remove an unnecessary LSN calculation while validating WAL page header
Date
Msg-id CALj2ACXuh4Ms9j9sxMYdtHEe=5sFcyrs-GAHyADu_A_G71kZTg@mail.gmail.com
Whole thread Raw
Responses Re: Remove an unnecessary LSN calculation while validating WAL page header
List pgsql-hackers
Hi,

It looks like we have an unnecessary XLogSegNoOffsetToRecPtr() in
XLogReaderValidatePageHeader(). We pass the start LSN of the WAL page
and check if it matches with the LSN that was stored in the WAL page
header (xlp_pageaddr). We find segno, offset and LSN again using
XLogSegNoOffsetToRecPtr(). This happens to be the same as the passed
in LSN 'recptr'.

Here's a tiny patch removing the unnecessary XLogSegNoOffsetToRecPtr()
and using the passed in 'recptr'.

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

Attachment

pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Allow file inclusion in pg_hba and pg_ident files
Next
From: Bharath Rupireddy
Date:
Subject: Re: ps command does not show walsender's connected db