Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1f113ab

Browse files
committed
Move StartupCLOG() calls to just after we initialize ShmemVariableCache.
Previously, the hot_standby=off code path did this at end of recovery, while the hot_standby=on code path did it at the beginning of recovery. It's better to do this in only one place because (a) it's simpler, (b) StartupCLOG() is trivial so trying to postpone the work isn't useful, and (c) this will make it possible to simplify some other logic. 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 e42b3c3 commit 1f113ab

File tree

1 file changed

+10
-7
lines changed
  • src/backend/access/transam

1 file changed

+10
-7
lines changed

src/backend/access/transam/xlog.c

+10-7
Original file line numberDiff line numberDiff line change
@@ -6855,6 +6855,13 @@ StartupXLOG(void)
68556855
*/
68566856
StartupReorderBuffer();
68576857

6858+
/*
6859+
* Startup CLOG. This must be done after ShmemVariableCache->nextXid
6860+
* has been initialized and before we accept connections or begin WAL
6861+
* replay.
6862+
*/
6863+
StartupCLOG();
6864+
68586865
/*
68596866
* Startup MultiXact. We need to do this early to be able to replay
68606867
* truncations.
@@ -7125,11 +7132,10 @@ StartupXLOG(void)
71257132
ProcArrayInitRecovery(XidFromFullTransactionId(ShmemVariableCache->nextXid));
71267133

71277134
/*
7128-
* Startup commit log and subtrans only. MultiXact and commit
7135+
* Startup subtrans only. CLOG, MultiXact and commit
71297136
* timestamp have already been started up and other SLRUs are not
71307137
* maintained during recovery and need not be started yet.
71317138
*/
7132-
StartupCLOG();
71337139
StartupSUBTRANS(oldestActiveXID);
71347140

71357141
/*
@@ -7945,14 +7951,11 @@ StartupXLOG(void)
79457951
LWLockRelease(ProcArrayLock);
79467952

79477953
/*
7948-
* Start up the commit log and subtrans, if not already done for hot
7949-
* standby. (commit timestamps are started below, if necessary.)
7954+
* Start up subtrans, if not already done for hot standby. (commit
7955+
* timestamps are started below, if necessary.)
79507956
*/
79517957
if (standbyState == STANDBY_DISABLED)
7952-
{
7953-
StartupCLOG();
79547958
StartupSUBTRANS(oldestActiveXID);
7955-
}
79567959

79577960
/*
79587961
* Perform end of recovery actions for any SLRUs that need it.

0 commit comments

Comments
 (0)