pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dennis Jacobfeuerborn <dennisml@conversis.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: "invalid record length" after restoring pg_basebackup
Date: Mon, 16 Nov 2020 10:03:41 -0500
Message-ID: <756951.1605539021@sss.pgh.pa.us> (raw)
In-Reply-To: <5a773ed9-9555-902e-f240-8720d64310ca@conversis.de>
References: <c729cdd1-73c3-73f8-9f40-dd0fc84efb29@conversis.de>
	<285451.1605279777@sss.pgh.pa.us>
	<5a773ed9-9555-902e-f240-8720d64310ca@conversis.de>

Dennis Jacobfeuerborn <dennisml@conversis.de> writes:
> On 11/13/20 4:02 PM, Tom Lane wrote:
>> This looks quite normal to me.  If you'd pulled the power plug on the
>> primary system at the time you made this backup, you would likely see
>> the same message at the end of its crash recovery.  Some sort of
>> corrupt-WAL-entry report is expected at the end of WAL replay anytime
>> you didn't have a clean shutdown.

> But the system the backup was pulled from kept running fine. Also
> wouldn't that make re-attaching the system to the primary impossible
> since replication cannot be continued due to the broken WAL record?

There is no "broken WAL record".  There is only junk following the
primary's current WAL write point.

> What I would expect is that pg_basebackup only transfer healthy WAL
> entries so that a restored system can pick up right after that with
> streaming replication.

You need to adjust your expectations.  pg_basebackup doesn't parse the WAL
data, because it has no need to.  It just copies whole WAL segment files.

			regards, tom lane





view thread (4+ messages)

Message-ID: <756951.1605539021@sss.pgh.pa.us>
Permalink:  ../756951.1605539021@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/756951.1605539021@sss.pgh.pa.us

 · 

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dennisml@conversis.de
  Subject: Re: "invalid record length" after restoring pg_basebackup
  In-Reply-To: <756951.1605539021@sss.pgh.pa.us>
  References: <c729cdd1-73c3-73f8-9f40-dd0fc84efb29@conversis.de> <285451.1605279777@sss.pgh.pa.us> <5a773ed9-9555-902e-f240-8720d64310ca@conversis.de> <756951.1605539021@sss.pgh.pa.us>

* 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