A pretty minor issue: when reporting that WAL appears invalid because
contrecord length doesn't match, we may as well print to the server log
the value that we're expecting. Patch attached.
--
Álvaro Herrera http://www.flickr.com/photos/alvherre/
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index 67996018da..b69cf80b59 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -464,8 +464,9 @@ XLogReadRecord(XLogReaderState *state, char **errormsg)
total_len != (pageHeader->xlp_rem_len + gotlen))
{
report_invalid_record(state,
- "invalid contrecord length %u at %X/%X",
+ "invalid contrecord length %u (expected %lld) at %X/%X",
pageHeader->xlp_rem_len,
+ (long long) total_len - gotlen,
(uint32) (RecPtr >> 32), (uint32) RecPtr);
goto err;
}