mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Fix timing of Startup CLOG and MultiXact during Hot Standby
Patch by me, bug report by Chris Redekop, analysis by Florian Pflug
This commit is contained in:
@ -6384,10 +6384,12 @@ StartupXLOG(void)
|
||||
oldestActiveXID = checkPoint.oldestActiveXid;
|
||||
Assert(TransactionIdIsValid(oldestActiveXID));
|
||||
|
||||
/* Startup commit log and related stuff */
|
||||
/*
|
||||
* Startup commit log and subtrans only. Other SLRUs are not
|
||||
* maintained during recovery and need not be started yet.
|
||||
*/
|
||||
StartupCLOG();
|
||||
StartupSUBTRANS(oldestActiveXID);
|
||||
StartupMultiXact();
|
||||
|
||||
/*
|
||||
* If we're beginning at a shutdown checkpoint, we know that
|
||||
@ -6876,16 +6878,21 @@ StartupXLOG(void)
|
||||
TransactionIdRetreat(ShmemVariableCache->latestCompletedXid);
|
||||
|
||||
/*
|
||||
* Start up the commit log and related stuff, too. In hot standby mode we
|
||||
* did this already before WAL replay.
|
||||
* Start up the commit log and subtrans, if not already done for
|
||||
* hot standby.
|
||||
*/
|
||||
if (standbyState == STANDBY_DISABLED)
|
||||
{
|
||||
StartupCLOG();
|
||||
StartupSUBTRANS(oldestActiveXID);
|
||||
StartupMultiXact();
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform end of recovery actions for any SLRUs that need it.
|
||||
*/
|
||||
StartupMultiXact();
|
||||
TrimCLOG();
|
||||
|
||||
/* Reload shared-memory state for prepared transactions */
|
||||
RecoverPreparedTransactions();
|
||||
|
||||
|
Reference in New Issue
Block a user