Skip to content

Commit f43e295

Browse files
committed
Report expected contrecord length on mismatch
When reading a WAL record fails to find continuation record(s) of the proper length, report what it expects, for clarity. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/20200903212152.GA15319@alvherre.pgsql
1 parent 38a2d70 commit f43e295

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/access/transam/xlogreader.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,9 @@ XLogReadRecord(XLogReaderState *state, char **errormsg)
464464
total_len != (pageHeader->xlp_rem_len + gotlen))
465465
{
466466
report_invalid_record(state,
467-
"invalid contrecord length %u at %X/%X",
467+
"invalid contrecord length %u (expected %lld) at %X/%X",
468468
pageHeader->xlp_rem_len,
469+
((long long) total_len) - gotlen,
469470
(uint32) (RecPtr >> 32), (uint32) RecPtr);
470471
goto err;
471472
}

0 commit comments

Comments
 (0)