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

Commit ae293d3

Browse files
committed
Make sure ControlFile logId/logSeg don't go backwards (barely possible given a
slow backend, if we update unconditionally as the code did before).
1 parent 4bcb80a commit ae293d3

File tree

1 file changed

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

1 file changed

+4
-3
lines changed

src/backend/access/transam/xlog.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.60 2001/03/17 20:54:13 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.61 2001/03/18 00:30:27 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1003,8 +1003,9 @@ XLogWrite(XLogwrtRqst WriteRqst)
10031003

10041004
/* update pg_control, unless someone else already did */
10051005
SpinAcquire(ControlFileLockId);
1006-
if (ControlFile->logId != openLogId ||
1007-
ControlFile->logSeg != openLogSeg + 1)
1006+
if (ControlFile->logId < openLogId ||
1007+
(ControlFile->logId == openLogId &&
1008+
ControlFile->logSeg < openLogSeg + 1))
10081009
{
10091010
ControlFile->logId = openLogId;
10101011
ControlFile->logSeg = openLogSeg + 1;

0 commit comments

Comments
 (0)