summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2011-11-02 08:06:54 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2011-11-02 08:06:54 +0000
commit9e5fe4d49227c5c5297410d54d6551a726814adc (patch)
treed52c92a8ca527ff0f7e0a664f71b5cb9c4b8f982 /src/backend/access/transam/xlog.c
parent5e4dd5f63ba2f4ac6f78c42f975b58e15291f64a (diff)
Fix timing of Startup CLOG and MultiXact during Hot Standby
Patch by me, bug report by Chris Redekop, analysis by Florian Pflug
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 633450fbc7b..60ea3f7f1ed 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -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();