From 2f55c535e1f026929cf20855b3790d3632062d42 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Wed, 2 Nov 2011 08:03:21 +0000 Subject: Fix timing of Startup CLOG and MultiXact during Hot Standby Patch by me, bug report by Chris Redekop, analysis by Florian Pflug --- src/backend/access/transam/xlog.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/backend/access/transam/xlog.c') diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 6c18db4050f..906292690d6 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6067,10 +6067,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 @@ -6530,16 +6532,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(); -- cgit v1.2.3