|
7 | 7 | * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 |
| - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.319 2008/09/23 09:20:35 heikki Exp $ |
| 10 | + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.320 2008/10/30 04:06:16 tgl Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -4698,6 +4698,9 @@ exitArchiveRecovery(TimeLineID endTLI, uint32 endLogId, uint32 endLogSeg)
|
4698 | 4698 | *
|
4699 | 4699 | * Returns TRUE if we are stopping, FALSE otherwise. On TRUE return,
|
4700 | 4700 | * *includeThis is set TRUE if we should apply this record before stopping.
|
| 4701 | + * |
| 4702 | + * We also track the timestamp of the latest applied COMMIT/ABORT record |
| 4703 | + * in recoveryLastXTime, for logging purposes. |
4701 | 4704 | * Also, some information is saved in recoveryStopXid et al for use in
|
4702 | 4705 | * annotating the new timeline's history file.
|
4703 | 4706 | */
|
@@ -4729,12 +4732,12 @@ recoveryStopsHere(XLogRecord *record, bool *includeThis)
|
4729 | 4732 | else
|
4730 | 4733 | return false;
|
4731 | 4734 |
|
4732 |
| - /* Remember the most recent COMMIT/ABORT time for logging purposes */ |
4733 |
| - recoveryLastXTime = recordXtime; |
4734 |
| - |
4735 | 4735 | /* Do we have a PITR target at all? */
|
4736 | 4736 | if (!recoveryTarget)
|
| 4737 | + { |
| 4738 | + recoveryLastXTime = recordXtime; |
4737 | 4739 | return false;
|
| 4740 | + } |
4738 | 4741 |
|
4739 | 4742 | if (recoveryTargetExact)
|
4740 | 4743 | {
|
@@ -4798,7 +4801,12 @@ recoveryStopsHere(XLogRecord *record, bool *includeThis)
|
4798 | 4801 | recoveryStopXid,
|
4799 | 4802 | timestamptz_to_str(recoveryStopTime))));
|
4800 | 4803 | }
|
| 4804 | + |
| 4805 | + if (recoveryStopAfter) |
| 4806 | + recoveryLastXTime = recordXtime; |
4801 | 4807 | }
|
| 4808 | + else |
| 4809 | + recoveryLastXTime = recordXtime; |
4802 | 4810 |
|
4803 | 4811 | return stopsHere;
|
4804 | 4812 | }
|
|
0 commit comments