diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-18 00:30:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-18 00:30:27 +0000 |
commit | ae293d33cfed8e0cfc6b6ceca470ef07134cd534 (patch) | |
tree | 10daf45141494d3b996150805022942c3c83a85e /src/backend/access/transam/xlog.c | |
parent | 4bcb80a3e3112fb5969c3fbabaa5ecd3bd95f997 (diff) | |
download | postgresql-ae293d33cfed8e0cfc6b6ceca470ef07134cd534.tar.gz postgresql-ae293d33cfed8e0cfc6b6ceca470ef07134cd534.zip |
Make sure ControlFile logId/logSeg don't go backwards (barely possible given a
slow backend, if we update unconditionally as the code did before).
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 5bbc4812ff8..9a841a4e3a0 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.60 2001/03/17 20:54:13 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.61 2001/03/18 00:30:27 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1003,8 +1003,9 @@ XLogWrite(XLogwrtRqst WriteRqst) /* update pg_control, unless someone else already did */ SpinAcquire(ControlFileLockId); - if (ControlFile->logId != openLogId || - ControlFile->logSeg != openLogSeg + 1) + if (ControlFile->logId < openLogId || + (ControlFile->logId == openLogId && + ControlFile->logSeg < openLogSeg + 1)) { ControlFile->logId = openLogId; ControlFile->logSeg = openLogSeg + 1; |