Do GetRunningTransactionData() immediately prior to a shutdown checkpoint.
authorSimon Riggs <[email protected]>
Thu, 1 Oct 2009 15:11:51 +0000 (16:11 +0100)
committerSimon Riggs <[email protected]>
Thu, 1 Oct 2009 15:11:51 +0000 (16:11 +0100)
src/backend/access/transam/xlog.c

index 51280c63c69af3b1c915b6c8d73838cb6a15507f..a8b2565897cc887273bf8739b9dfe5fcf11cb7c0 100644 (file)
@@ -7060,6 +7060,15 @@ ShutdownXLOG(int code, Datum arg)
                CreateRestartPoint(CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_IMMEDIATE);
        else
        {
+               /*
+                * 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();
+
                /*
                 * If archiving is enabled, rotate the last XLOG file so that all the
                 * remaining records are archived (postmaster wakes up the archiver