Skip to content

Commit 51970fa

Browse files
committed
Fix initialization of fake LSN for unlogged relations
9155580 has changed the value of the first fake LSN for unlogged relations from 1 to FirstNormalUnloggedLSN (aka 1000), GiST requiring a non-zero LSN on some pages to allow an interlocking logic to work, but its value was still initialized to 1 at the beginning of recovery or after running pg_resetwal. This fixes the initialization for both code paths. Author: Takayuki Tsunakawa Reviewed-by: Dilip Kumar, Kyotaro Horiguchi, Michael Paquier Discussion: https://postgr.es/m/OSBPR01MB2503CE851940C17DE44AE3D9FE6F0@OSBPR01MB2503.jpnprd01.prod.outlook.com Backpatch-through: 12
1 parent b804521 commit 51970fa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6687,7 +6687,7 @@ StartupXLOG(void)
66876687
if (ControlFile->state == DB_SHUTDOWNED)
66886688
XLogCtl->unloggedLSN = ControlFile->unloggedLSN;
66896689
else
6690-
XLogCtl->unloggedLSN = 1;
6690+
XLogCtl->unloggedLSN = FirstNormalUnloggedLSN;
66916691

66926692
/*
66936693
* We must replay WAL entries using the same TimeLineID they were created

src/bin/pg_resetwal/pg_resetwal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ GuessControlValues(void)
699699
ControlFile.state = DB_SHUTDOWNED;
700700
ControlFile.time = (pg_time_t) time(NULL);
701701
ControlFile.checkPoint = ControlFile.checkPointCopy.redo;
702-
ControlFile.unloggedLSN = 1;
702+
ControlFile.unloggedLSN = FirstNormalUnloggedLSN;
703703

704704
/* minRecoveryPoint, backupStartPoint and backupEndPoint can be left zero */
705705

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy