Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb457b2a

Browse files
committed
If pg_stop_backup() is called just after switching to a new xlog file,
wait for the previous instead of the new file to be archived.Based on patch by Simon Riggs.
1 parentb0729b8 commitb457b2a

File tree

1 file changed

+10
-4
lines changed
  • src/backend/access/transam

1 file changed

+10
-4
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, 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.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 $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -6674,6 +6674,8 @@ pg_stop_backup(PG_FUNCTION_ARGS)
66746674
charhistfilepath[MAXPGPATH];
66756675
charstartxlogfilename[MAXFNAMELEN];
66766676
charstopxlogfilename[MAXFNAMELEN];
6677+
charlastxlogfilename[MAXFNAMELEN];
6678+
charhistfilename[MAXFNAMELEN];
66776679
uint32_logId;
66786680
uint32_logSeg;
66796681
FILE*lfp;
@@ -6801,14 +6803,18 @@ pg_stop_backup(PG_FUNCTION_ARGS)
68016803
* we assume the admin wanted his backup to work completely. If you
68026804
* don't wish to wait, you can set statement_timeout.
68036805
*/
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,
68056811
startpoint.xrecoff %XLogSegSize);
68066812

68076813
seconds_before_warning=60;
68086814
waits=0;
68096815

6810-
while (XLogArchiveIsBusy(stopxlogfilename)||
6811-
XLogArchiveIsBusy(histfilepath))
6816+
while (XLogArchiveIsBusy(lastxlogfilename)||
6817+
XLogArchiveIsBusy(histfilename))
68126818
{
68136819
CHECK_FOR_INTERRUPTS();
68146820

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp