diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2011-11-02 08:07:44 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2011-11-02 08:07:44 +0000 |
commit | f8409b39d1dae28f063b378b9edee1a657845503 (patch) | |
tree | 1a74543e730865be28c65edd2c49760269d02502 /src/backend/access/transam/xlog.c | |
parent | c2891b46a4b04b80e1fe28ad0bfd75b40e97ea3e (diff) | |
download | postgresql-f8409b39d1dae28f063b378b9edee1a657845503.tar.gz postgresql-f8409b39d1dae28f063b378b9edee1a657845503.zip |
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.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index a6aee9eb30c..bf57b3bf49e 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6410,10 +6410,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 @@ -6914,16 +6916,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(); |