pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: report expected contrecord size
Date: Thu, 3 Sep 2020 17:21:52 -0400
Message-ID: <20200903212152.GA15319@alvherre.pgsql> (raw)

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/

Attachments:

report-contrecord.patch (text/x-diff, 671B) download 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; }

view thread (7+ messages)  latest in thread

Message-ID: <20200903212152.GA15319@alvherre.pgsql>
Permalink:  ../20200903212152.GA15319@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200903212152.GA15319@alvherre.pgsql

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com
  Subject: Re: report expected contrecord size
  In-Reply-To: <20200903212152.GA15319@alvherre.pgsql>
  References: <20200903212152.GA15319@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox