Skip to content

Commit ef41c3f

Browse files
committed
Fix determination of broken LSN in OVERWRITTEN_CONTRECORD
In commit ff9f111 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
1 parent 04875ae commit ef41c3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/transam/xlogreader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ XLogReadRecord(XLogReaderState *state, char **errormsg)
465465
*/
466466
if (pageHeader->xlp_info & XLP_FIRST_IS_OVERWRITE_CONTRECORD)
467467
{
468-
state->overwrittenRecPtr = state->currRecPtr;
468+
state->overwrittenRecPtr = RecPtr;
469469
ResetDecoder(state);
470470
RecPtr = targetPagePtr;
471471
goto restart;

0 commit comments

Comments
 (0)