diff options
author | Robert Haas <rhaas@postgresql.org> | 2021-01-27 13:07:41 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2021-01-27 13:11:30 -0500 |
commit | 0fcc2decd485a61321a3220d8f76cb108b082009 (patch) | |
tree | e65e7b98d118e1c8d51d25103bacc65fb399fbe6 /src/backend/access/transam/clog.c | |
parent | 662affcfe9e816584e3d8602b3b4005236931bbb (diff) | |
download | postgresql-0fcc2decd485a61321a3220d8f76cb108b082009.tar.gz postgresql-0fcc2decd485a61321a3220d8f76cb108b082009.zip |
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
Diffstat (limited to 'src/backend/access/transam/clog.c')
-rw-r--r-- | src/backend/access/transam/clog.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index 410d02a3943..5ae962b86e1 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -1011,12 +1011,6 @@ clog_redo(XLogReaderState *record) memcpy(&xlrec, XLogRecGetData(record), sizeof(xl_clog_truncate)); - /* - * During XLOG replay, latest_page_number isn't set up yet; insert a - * suitable value to bypass the sanity test in SimpleLruTruncate. - */ - XactCtl->shared->latest_page_number = xlrec.pageno; - AdvanceOldestClogXid(xlrec.oldestXact); SimpleLruTruncate(XactCtl, xlrec.pageno); |