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