Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 44bd3ed332d6ad3207f38b3b6deb6083f0baddf5
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2021-11-26T14:14:27Z
Releases: 15.0
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

In commit ff9f111bce24 I mixed up inconsistent definitions of the LSN of
the first record in a page, when the previous record ends exactly at the
page boundary.  The correct LSN is adjusted to skip the WAL page header;
I failed to use that when setting XLogReaderState->overwrittenRecPtr,
so at WAL replay time VerifyOverwriteContrecord would refuse to let
replay continue past that record.

Backpatch to 10.  9.6 also contains this bug, but it's no longer being
maintained.

Discussion: https://postgr.es/m/45597.1637694259@sss.pgh.pa.us

Files

PathChange+/−
src/backend/access/transam/xlogreader.c modified +1 −1

Discussion