mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Fix recoveryLastXTime logic so that it actually does what one would expect.
Per gripe from Kevin Grittner. Backpatch to 8.3, where the bug was introduced.
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.319 2008/09/23 09:20:35 heikki Exp $
|
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.320 2008/10/30 04:06:16 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -4698,6 +4698,9 @@ exitArchiveRecovery(TimeLineID endTLI, uint32 endLogId, uint32 endLogSeg)
|
|||||||
*
|
*
|
||||||
* Returns TRUE if we are stopping, FALSE otherwise. On TRUE return,
|
* Returns TRUE if we are stopping, FALSE otherwise. On TRUE return,
|
||||||
* *includeThis is set TRUE if we should apply this record before stopping.
|
* *includeThis is set TRUE if we should apply this record before stopping.
|
||||||
|
*
|
||||||
|
* We also track the timestamp of the latest applied COMMIT/ABORT record
|
||||||
|
* in recoveryLastXTime, for logging purposes.
|
||||||
* Also, some information is saved in recoveryStopXid et al for use in
|
* Also, some information is saved in recoveryStopXid et al for use in
|
||||||
* annotating the new timeline's history file.
|
* annotating the new timeline's history file.
|
||||||
*/
|
*/
|
||||||
@ -4729,12 +4732,12 @@ recoveryStopsHere(XLogRecord *record, bool *includeThis)
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Remember the most recent COMMIT/ABORT time for logging purposes */
|
|
||||||
recoveryLastXTime = recordXtime;
|
|
||||||
|
|
||||||
/* Do we have a PITR target at all? */
|
/* Do we have a PITR target at all? */
|
||||||
if (!recoveryTarget)
|
if (!recoveryTarget)
|
||||||
|
{
|
||||||
|
recoveryLastXTime = recordXtime;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (recoveryTargetExact)
|
if (recoveryTargetExact)
|
||||||
{
|
{
|
||||||
@ -4798,7 +4801,12 @@ recoveryStopsHere(XLogRecord *record, bool *includeThis)
|
|||||||
recoveryStopXid,
|
recoveryStopXid,
|
||||||
timestamptz_to_str(recoveryStopTime))));
|
timestamptz_to_str(recoveryStopTime))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (recoveryStopAfter)
|
||||||
|
recoveryLastXTime = recordXtime;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
recoveryLastXTime = recordXtime;
|
||||||
|
|
||||||
return stopsHere;
|
return stopsHere;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user