Re: "invalid record length" after restoring pg_basebackup

From: Dennis Jacobfeuerborn <dennisml(at)conversis(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: "invalid record length" after restoring pg_basebackup
Date: 2020-11-16 10:39:41
Message-ID: 5a773ed9-9555-902e-f240-8720d64310ca@conversis.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/13/20 4:02 PM, Tom Lane wrote:
> Dennis Jacobfeuerborn <dennisml(at)conversis(dot)de> writes:
>> All of this works fine and the logs report that the db reaches a
>> consistent recovery state but as last entry it reports an "invalid
>> record length":
>
> 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?
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.

Regards,
Dennis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniele Varrazzo 2020-11-16 11:48:15 psycopg3 COPY support
Previous Message Lukasz Biegaj 2020-11-16 09:20:42 Logical replication gradually slowing down, then hanging.