Fix determination of broken LSN in OVERWRITTEN_CONTRECORD

In commit ff9f111bce 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
This commit is contained in:
Alvaro Herrera 2021-11-26 11:14:27 -03:00
parent 4597fd78d6
commit 44bd3ed332
No known key found for this signature in database
GPG Key ID: 1C20ACB9D5C564AE
1 changed files with 1 additions and 1 deletions

View File

@ -467,7 +467,7 @@ restart:
*/
if (pageHeader->xlp_info & XLP_FIRST_IS_OVERWRITE_CONTRECORD)
{
state->overwrittenRecPtr = state->currRecPtr;
state->overwrittenRecPtr = RecPtr;
ResetDecoder(state);
RecPtr = targetPagePtr;
goto restart;