pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make recovery report error message when invalid page header is f
Date: Tue, 05 Oct 2021 15:16:50 +0000
Message-ID: <E1mXmBW-0005hg-71@gemulon.postgresql.org> (raw)

Make recovery report error message when invalid page header is found.

Commit 0668719801 changed XLogPageRead() so that it validated the page
header, if invalid page header was found reset the error message and
retried reading the page, to fix the scenario where streaming standby
got stuck at a continuation record. This change hid the error message
about invalid page header, which would make it harder for users to
investigate what the actual issue was found in WAL.

To fix the issue, this commit makes XLogPageRead() report the error
message when invalid page header is found.

When not in standby mode, an invalid page header should cause recovery
to end, not retry reading the page, so XLogPageRead() doesn't need to
validate the page header for the retry. Instead, ReadPageInternal() should
be responsible for the validation in that case. Therefore this commit
changes XLogPageRead() so that if not in standby mode it doesn't validate
the page header for the retry.

Reported-by: Yugo Nagata
Author: Yugo Nagata, Kyotaro Horiguchi
Reviewed-by: Ranier Vilela, Fujii Masao
Discussion: https://postgr.es/m/20210718045505.32f463ed6c227111038d8ae4@sraoss.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/68601985e699adeb267636fd19d3d6113554bd1f

Modified Files
--------------
src/backend/access/transam/xlog.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1mXmBW-0005hg-71@gemulon.postgresql.org>
Permalink:  ../E1mXmBW-0005hg-71@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mXmBW-0005hg-71@gemulon.postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make recovery report error message when invalid page header is f
  In-Reply-To: <E1mXmBW-0005hg-71@gemulon.postgresql.org>

* 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