Skip to content

Commit 11ab44f

Browse files
committed
[Issue #118]: trust txid_snapshot_xmax() when determining recovery_xid
1 parent 2413516 commit 11ab44f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/backup.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2019,18 +2019,18 @@ pg_stop_backup(pgBackup *backup, PGconn *pg_startbackup_conn,
20192019
xlog_path = arclog_path;
20202020

20212021
backup->stop_lsn = stop_backup_lsn;
2022+
backup->recovery_xid = recovery_xid;
20222023

20232024
elog(LOG, "Getting the Recovery Time from WAL");
20242025

20252026
/* iterate over WAL from stop_backup lsn to start_backup lsn */
20262027
if (!read_recovery_info(xlog_path, backup->tli,
20272028
instance_config.xlog_seg_size,
20282029
backup->start_lsn, backup->stop_lsn,
2029-
&backup->recovery_time, &backup->recovery_xid))
2030+
&backup->recovery_time))
20302031
{
20312032
elog(LOG, "Failed to find Recovery Time in WAL, forced to trust current_timestamp");
20322033
backup->recovery_time = recovery_time;
2033-
backup->recovery_xid = recovery_xid;
20342034
}
20352035
}
20362036
}

src/parsexlog.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ validate_wal(pgBackup *backup, const char *archivedir,
425425
bool
426426
read_recovery_info(const char *archivedir, TimeLineID tli, uint32 wal_seg_size,
427427
XLogRecPtr start_lsn, XLogRecPtr stop_lsn,
428-
time_t *recovery_time, TransactionId *recovery_xid)
428+
time_t *recovery_time)
429429
{
430430
XLogRecPtr startpoint = stop_lsn;
431431
XLogReaderState *xlogreader;
@@ -472,7 +472,6 @@ read_recovery_info(const char *archivedir, TimeLineID tli, uint32 wal_seg_size,
472472
if (getRecordTimestamp(xlogreader, &last_time))
473473
{
474474
*recovery_time = timestamptz_to_time_t(last_time);
475-
*recovery_xid = XLogRecGetXid(xlogreader);
476475

477476
/* Found timestamp in WAL record 'record' */
478477
res = true;

src/pg_probackup.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,7 @@ extern void validate_wal(pgBackup *backup, const char *archivedir,
707707
extern bool read_recovery_info(const char *archivedir, TimeLineID tli,
708708
uint32 seg_size,
709709
XLogRecPtr start_lsn, XLogRecPtr stop_lsn,
710-
time_t *recovery_time,
711-
TransactionId *recovery_xid);
710+
time_t *recovery_time);
712711
extern bool wal_contains_lsn(const char *archivedir, XLogRecPtr target_lsn,
713712
TimeLineID target_tli, uint32 seg_size);
714713
extern XLogRecPtr get_prior_record_lsn(const char *archivedir, XLogRecPtr start_lsn,

0 commit comments

Comments
 (0)