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 TrimCLOG(), don't reset XactCtl->shared->latest_page_number.
Date: Wed, 27 Jan 2021 20:57:57 +0000
Message-ID: <E1l4rsz-0007TW-JD@gemulon.postgresql.org> (raw)

In TrimCLOG(), don't reset XactCtl->shared->latest_page_number.

Since the CLOG page number is not recorded directly in the checkpoint
record, we have to use ShmemVariableCache->nextXid to figure out the
latest CLOG page number at the start of recovery. However, as recovery
progresses, replay of CLOG/EXTEND records will update our notion of
the latest page number, and we should rely on that being accurate
rather than recomputing the value based on an updated notion of
nextXid. ShmemVariableCache->nextXid is only an approximation
during recovery anyway, whereas CLOG/EXTEND records are an
authoritative representation of how the SLRU has been updated.

Commit 0fcc2decd485a61321a3220d8f76cb108b082009 makes this
simplification possible, as before that change clog_redo() might
have injected a bogus value here, and we'd want to get rid of
that before entering normal running.

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/69059d3b2f0754c8e661ba479f7121e6631cdf4a

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



Message-ID: <E1l4rsz-0007TW-JD@gemulon.postgresql.org>
Permalink:  ../E1l4rsz-0007TW-JD@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l4rsz-0007TW-JD@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 TrimCLOG(), don't reset XactCtl->shared->latest_page_number.
  In-Reply-To: <E1l4rsz-0007TW-JD@gemulon.postgresql.org>
  References: <E1l4rsz-0007TW-JD@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