aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-04-22 19:51:12 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-04-22 19:51:12 +0000
commitbae8102f52863bdb29b5c5e1ee7e27a8b0f5b9c7 (patch)
tree13c6b2e3e33018a34542afc34c1075e5569824a8
parent73b44dca38774128acb449cbc85210970c70e91e (diff)
downloadpostgresql-bae8102f52863bdb29b5c5e1ee7e27a8b0f5b9c7.tar.gz
postgresql-bae8102f52863bdb29b5c5e1ee7e27a8b0f5b9c7.zip
After archive recovery, mark the last WAL segment from the parent timeline
ready for archival. It was marked at the next checkpoint anyway, but waiting for the next checkpoint is an unnecessary delay. Fujii Masao
-rw-r--r--src/backend/access/transam/xlog.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 65484b6f70d..43c5e3095a8 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.335 2009/04/07 00:31:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.336 2009/04/22 19:51:12 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4850,10 +4850,22 @@ exitArchiveRecovery(TimeLineID endTLI, uint32 endLogId, uint32 endLogSeg)
* If we are establishing a new timeline, we have to copy data from
* the last WAL segment of the old timeline to create a starting WAL
* segment for the new timeline.
+ *
+ * Notify the archiver that the last WAL segment of the old timeline
+ * is ready to copy to archival storage. Otherwise, it is not archived
+ * for a while.
*/
if (endTLI != ThisTimeLineID)
+ {
XLogFileCopy(endLogId, endLogSeg,
endTLI, endLogId, endLogSeg);
+
+ if (XLogArchivingActive())
+ {
+ XLogFileName(xlogpath, endTLI, endLogId, endLogSeg);
+ XLogArchiveNotify(xlogpath);
+ }
+ }
}
/*