Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bae8102

Browse files
committed
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
1 parent 73b44dc commit bae8102

File tree

1 file changed

+13
-1
lines changed
  • src/backend/access/transam

1 file changed

+13
-1
lines changed

src/backend/access/transam/xlog.c

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.335 2009/04/07 00:31:26 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.336 2009/04/22 19:51:12 heikki Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -4850,10 +4850,22 @@ exitArchiveRecovery(TimeLineID endTLI, uint32 endLogId, uint32 endLogSeg)
48504850
* If we are establishing a new timeline, we have to copy data from
48514851
* the last WAL segment of the old timeline to create a starting WAL
48524852
* segment for the new timeline.
4853+
*
4854+
* Notify the archiver that the last WAL segment of the old timeline
4855+
* is ready to copy to archival storage. Otherwise, it is not archived
4856+
* for a while.
48534857
*/
48544858
if (endTLI != ThisTimeLineID)
4859+
{
48554860
XLogFileCopy(endLogId, endLogSeg,
48564861
endTLI, endLogId, endLogSeg);
4862+
4863+
if (XLogArchivingActive())
4864+
{
4865+
XLogFileName(xlogpath, endTLI, endLogId, endLogSeg);
4866+
XLogArchiveNotify(xlogpath);
4867+
}
4868+
}
48574869
}
48584870

48594871
/*

0 commit comments

Comments
 (0)