aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/clog.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2021-01-27 15:52:34 -0500
committerRobert Haas <rhaas@postgresql.org>2021-01-27 15:52:34 -0500
commit69059d3b2f0754c8e661ba479f7121e6631cdf4a (patch)
tree95dc06a4c6dedacb3d782d52dc69ad8f07eff42f /src/backend/access/transam/clog.c
parent0fcc2decd485a61321a3220d8f76cb108b082009 (diff)
downloadpostgresql-69059d3b2f0754c8e661ba479f7121e6631cdf4a.tar.gz
postgresql-69059d3b2f0754c8e661ba479f7121e6631cdf4a.zip
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
Diffstat (limited to 'src/backend/access/transam/clog.c')
-rw-r--r--src/backend/access/transam/clog.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c
index 5ae962b86e1..6fa4713fb4d 100644
--- a/src/backend/access/transam/clog.c
+++ b/src/backend/access/transam/clog.c
@@ -774,11 +774,6 @@ TrimCLOG(void)
LWLockAcquire(XactSLRULock, LW_EXCLUSIVE);
/*
- * Re-Initialize our idea of the latest page number.
- */
- XactCtl->shared->latest_page_number = pageno;
-
- /*
* Zero out the remainder of the current clog page. Under normal
* circumstances it should be zeroes already, but it seems at least
* theoretically possible that XLOG replay will have settled on a nextXID