Re: corruption of WAL page header is never reported

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: nagata(at)sraoss(dot)co(dot)jp
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: corruption of WAL page header is never reported
Date: 2021-07-19 06:14:41
Message-ID: 20210719.151441.1342311546952131179.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

At Sun, 18 Jul 2021 04:55:05 +0900, Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp> wrote in
> Hello,
>
> I found that any corruption of WAL page header found during recovery is never
> reported in log messages. If wal page header is broken, it is detected in
> XLogReaderValidatePageHeader called from XLogPageRead, but the error messages
> are always reset and never reported.

Good catch! Currently recovery stops showing no reason if it is
stopped by page-header errors.

> I attached a patch to fix it in this way.

However, it is a kind of a roof-over-a-roof. What we should do is
just omitting the check in XLogPageRead while in standby mode.

> Or, if we wouldn't like to report an error for each check and also what we want
> to check here is just about old recycled WAL instead of header corruption itself,
> I wander that we could check just xlp_pageaddr instead of calling
> XLogReaderValidatePageHeader.

I'm not sure. But as described in the commit message, the commit
intended to save a common case and there's no obvious reason to (and
not to) restrict the check only to page address. So it uses the
established checking function.

I was tempted to adjust the comment just above by adding "while in
standby mode", but "so that we can retry immediately" is suggesting
that so I didn't do that in the attached.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v1-0001-Don-t-forget-message-of-hage-header-errors-while-.patch text/x-patch 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-07-19 06:20:54 Re: [PoC] Improve dead tuple storage for lazy vacuum
Previous Message Fujii Masao 2021-07-19 06:07:48 Re: RFC: Logging plan of the running query