aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2021-11-26 11:14:27 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2021-11-26 11:14:27 -0300
commitef41c3fd6c86d6fa504144996b339704347322c9 (patch)
tree128af2b99ed7dd712dcea0ca6d47b1e2a42a8233
parent04875ae92f14c0b23438e5316d92f82518bb068a (diff)
downloadpostgresql-ef41c3fd6c86d6fa504144996b339704347322c9.tar.gz
postgresql-ef41c3fd6c86d6fa504144996b339704347322c9.zip
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
-rw-r--r--src/backend/access/transam/xlogreader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index c0c2253fa1b..911bc91bc9c 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -465,7 +465,7 @@ restart:
*/
if (pageHeader->xlp_info & XLP_FIRST_IS_OVERWRITE_CONTRECORD)
{
- state->overwrittenRecPtr = state->currRecPtr;
+ state->overwrittenRecPtr = RecPtr;
ResetDecoder(state);
RecPtr = targetPagePtr;
goto restart;