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: In clog_redo(), don't set XactCtl->shared->latest_page_number.
Date: Wed, 27 Jan 2021 18:13:44 +0000
Message-ID: <E1l4pK4-0006XK-PH@gemulon.postgresql.org> (raw)

In clog_redo(), don't set XactCtl->shared->latest_page_number.

The comment is no longer accurate, and hasn't been entirely accurate
since Hot Standby was introduced. The original idea here was that
StartupCLOG() wouldn't be called until the end of recovery and
therefore this value would be uninitialized when this code is reached,
but Hot Standby made that true only when hot_standby=off, and commit
1f113abdf87cd085dee3927960bb4f70442b7250 means that this value is now
always initialized before replay even starts.

The original purpose of this code was to bypass the sanity check
in SimpleLruTruncate(), which will no longer occur: now, if something
is wrong, that sanity check might trip during recovery. That's
probably a good thing, because in the current code base
latest_page_number should always be initialized and therefore we
expect that the sanity check should pass. If it doesn't, something
has gone wrong, and complaining about it is appropriate.

Patch by me, reviewed by Heikki Linnakangas.

Discussion: http://postgr.es/m/CA+TgmoZYig9+AQodhF5sRXuKkJ=RgFDugLr3XX_dz_F-p=TwTg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0fcc2decd485a61321a3220d8f76cb108b082009

Modified Files
--------------
src/backend/access/transam/clog.c | 6 ------
1 file changed, 6 deletions(-)



Message-ID: <E1l4pK4-0006XK-PH@gemulon.postgresql.org>
Permalink:  ../E1l4pK4-0006XK-PH@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l4pK4-0006XK-PH@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: In clog_redo(), don't set XactCtl->shared->latest_page_number.
  In-Reply-To: <E1l4pK4-0006XK-PH@gemulon.postgresql.org>
  References: <E1l4pK4-0006XK-PH@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