From f8d333d548832b603272035634b32600346fbfa9 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Fri, 2 Oct 2009 08:33:44 +0100 Subject: [PATCH] Add in extra GetRunningTransactionData after shutdown checkpoint. --- src/backend/access/transam/xlog.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index a8b2565897..de682f1b57 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7063,11 +7063,10 @@ ShutdownXLOG(int code, Datum arg) /* * Take a snapshot of running transactions and write this to WAL. * This allows us to reconstruct the state of running transactions - * during archive recovery, if required. We do this even if we are - * not archiving, to allow a cold physical backup of the server to - * be useful as a read only standby. + * during archive recovery, if required. */ - GetRunningTransactionData(); + if (XLogArchivingActive() && XLogArchiveCommandSet()) + GetRunningTransactionData(); /* * If archiving is enabled, rotate the last XLOG file so that all the @@ -7079,6 +7078,15 @@ ShutdownXLOG(int code, Datum arg) RequestXLogSwitch(); CreateCheckPoint(CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_IMMEDIATE); + + /* + * Take a snapshot of running transactions and write this to WAL. + * This allows us to reconstruct the state of running transactions + * during archive recovery, if required. We do this even if we are + * not archiving, to allow a cold physical backup of the server to + * be useful as a read only standby. + */ + GetRunningTransactionData(); } ShutdownCLOG(); ShutdownSUBTRANS(); -- 2.39.5