]> granicus.if.org Git - postgresql/commitdiff
Fix STOP WAL LOCATION in backup history files no to return the next
authorItagaki Takahiro <itagaki.takahiro@gmail.com>
Fri, 19 Feb 2010 01:06:51 +0000 (01:06 +0000)
committerItagaki Takahiro <itagaki.takahiro@gmail.com>
Fri, 19 Feb 2010 01:06:51 +0000 (01:06 +0000)
segment of XLOG_BACKUP_END record even if the the record is placed
at a segment boundary. Furthermore the previous implementation could
return nonexistent segment file name when the boundary is in segments
that has "FE" suffix; We never use segments with "FF" suffix.

Backpatch to 8.0, where hot backup was introduced.

Reported by Fujii Masao.

src/backend/access/transam/xlog.c

index 400c5931be97b5d15466cec010bd4e785f787280..1ff0a3d397eb7bdc06ebcffc64a8c36ad3bf67d4 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.292.2.9 2009/09/13 18:32:26 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.292.2.10 2010/02/19 01:06:51 itagaki Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -6675,7 +6675,7 @@ pg_stop_backup(PG_FUNCTION_ARGS)
         */
        stoppoint = RequestXLogSwitch();
 
-       XLByteToSeg(stoppoint, _logId, _logSeg);
+       XLByteToPrevSeg(stoppoint, _logId, _logSeg);
        XLogFileName(stopxlogfilename, ThisTimeLineID, _logId, _logSeg);
 
        /* Use the log timezone here, not the session timezone */