pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove unnecessary call to ReadCheckpointRecord().
Date: Fri, 30 Jul 2021 12:38:17 +0000
Message-ID: <E1m9RmL-0007SR-HP@gemulon.postgresql.org> (raw)

Remove unnecessary call to ReadCheckpointRecord().

It should always be the case that the last checkpoint record is still
readable, because otherwise, a crash would leave us in a situation
from which we can't recover. Therefore the test removed by this patch
should always succeed. For it to fail, either there has to be a serious
bug in the code someplace, or the user has to be manually modifying
pg_wal while crash recovery is running. If it's the first one, we
should fix the bug. If it's the second one, they should stop, or
anyway they're doing so at their own risk. In neither case does
a full checkpoint instead of an end-of-recovery record seem like a
clear winner. Furthermore, rarely-taken code paths are particularly
vulnerable to bugs, so let's simplify by getting rid of this one.

Discussion: http://postgr.es/m/CA+TgmoYmw==TOJ6EzYb_vcjyS09NkzrVKSyBKUUyo1zBEaJASA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1d919de5eb3fffa7cc9479ed6d2915fb89794459

Modified Files
--------------
src/backend/access/transam/xlog.c | 34 +++++++++++-----------------------
1 file changed, 11 insertions(+), 23 deletions(-)



Message-ID: <E1m9RmL-0007SR-HP@gemulon.postgresql.org>
Permalink:  ../E1m9RmL-0007SR-HP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m9RmL-0007SR-HP@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 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-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Remove unnecessary call to ReadCheckpointRecord().
  In-Reply-To: <E1m9RmL-0007SR-HP@gemulon.postgresql.org>
  References: <E1m9RmL-0007SR-HP@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