Re: "invalid record length" after restoring pg_basebackup - Mailing list pgsql-general

From Tom Lane
Subject Re: "invalid record length" after restoring pg_basebackup
Date
Msg-id 756951.1605539021@sss.pgh.pa.us
Whole thread Raw
In response to Re: "invalid record length" after restoring pg_basebackup  (Dennis Jacobfeuerborn <dennisml@conversis.de>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Condor
Date:
Subject: Re: Unable to compile postgres 13.1 on Slackware current x64
Next
From: Laurenz Albe
Date:
Subject: Re: Unable to compile postgres 13.1 on Slackware current x64