From: Simon Riggs Date: Thu, 1 Oct 2009 15:11:51 +0000 (+0100) Subject: Do GetRunningTransactionData() immediately prior to a shutdown checkpoint. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=89fbde318f80bdb2fab19433ed3574da1a348977;p=users%2Fsimon%2Fpostgres.git Do GetRunningTransactionData() immediately prior to a shutdown checkpoint. --- diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 51280c63c6..a8b2565897 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -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