Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0fcc2de

Browse filesBrowse files
committed
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 1f113ab 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
1 parent 662affc commit 0fcc2de
Copy full SHA for 0fcc2de

File tree

Expand file treeCollapse file tree

1 file changed

+0
-6
lines changed
Filter options
  • src/backend/access/transam
Expand file treeCollapse file tree

1 file changed

+0
-6
lines changed

‎src/backend/access/transam/clog.c

Copy file name to clipboardExpand all lines: src/backend/access/transam/clog.c
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,12 +1011,6 @@ clog_redo(XLogReaderState *record)
10111011

10121012
memcpy(&xlrec, XLogRecGetData(record), sizeof(xl_clog_truncate));
10131013

1014-
/*
1015-
* During XLOG replay, latest_page_number isn't set up yet; insert a
1016-
* suitable value to bypass the sanity test in SimpleLruTruncate.
1017-
*/
1018-
XactCtl->shared->latest_page_number = xlrec.pageno;
1019-
10201014
AdvanceOldestClogXid(xlrec.oldestXact);
10211015

10221016
SimpleLruTruncate(XactCtl, xlrec.pageno);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.