|
7 | 7 | * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group |
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California |
9 | 9 | * |
10 | | - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.322 2008/11/09 17:51:15 tgl Exp $ |
| 10 | + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.323 2008/12/03 08:20:11 heikki Exp $ |
11 | 11 | * |
12 | 12 | *------------------------------------------------------------------------- |
13 | 13 | */ |
@@ -6674,6 +6674,8 @@ pg_stop_backup(PG_FUNCTION_ARGS) |
6674 | 6674 | char histfilepath[MAXPGPATH]; |
6675 | 6675 | char startxlogfilename[MAXFNAMELEN]; |
6676 | 6676 | char stopxlogfilename[MAXFNAMELEN]; |
| 6677 | + char lastxlogfilename[MAXFNAMELEN]; |
| 6678 | + char histfilename[MAXFNAMELEN]; |
6677 | 6679 | uint32 _logId; |
6678 | 6680 | uint32 _logSeg; |
6679 | 6681 | FILE *lfp; |
@@ -6801,14 +6803,18 @@ pg_stop_backup(PG_FUNCTION_ARGS) |
6801 | 6803 | * we assume the admin wanted his backup to work completely. If you |
6802 | 6804 | * don't wish to wait, you can set statement_timeout. |
6803 | 6805 | */ |
6804 | | - BackupHistoryFileName(histfilepath, ThisTimeLineID, _logId, _logSeg, |
| 6806 | + XLByteToPrevSeg(stoppoint, _logId, _logSeg); |
| 6807 | + XLogFileName(lastxlogfilename, ThisTimeLineID, _logId, _logSeg); |
| 6808 | + |
| 6809 | + XLByteToSeg(startpoint, _logId, _logSeg); |
| 6810 | + BackupHistoryFileName(histfilename, ThisTimeLineID, _logId, _logSeg, |
6805 | 6811 | startpoint.xrecoff % XLogSegSize); |
6806 | 6812 |
|
6807 | 6813 | seconds_before_warning = 60; |
6808 | 6814 | waits = 0; |
6809 | 6815 |
|
6810 | | - while (XLogArchiveIsBusy(stopxlogfilename) || |
6811 | | - XLogArchiveIsBusy(histfilepath)) |
| 6816 | + while (XLogArchiveIsBusy(lastxlogfilename) || |
| 6817 | + XLogArchiveIsBusy(histfilename)) |
6812 | 6818 | { |
6813 | 6819 | CHECK_FOR_INTERRUPTS(); |
6814 | 6820 |
|
|
0 commit comments