You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-07-16 07:14:15 +02:00
Fix history file parsing when fetched from archive
History file format has changed from 9.2 to 9.3 to indicate the WAL record when timeline branched off. In 9.2, the complete WAL file name was used while in 9.3 the WAL record is used (like 1/4000090). pg_rman contains a copy of a function of postgres core code to parse the history file that was not anymore compatible, leading to errors related to timelines.
This commit is contained in:
18
xlog.c
18
xlog.c
@ -109,24 +109,6 @@ xlog_is_complete_wal(const pgFile *file, int server_version)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
xlog_logfname2lsn(const char *logfname, XLogRecPtr *lsn)
|
||||
{
|
||||
uint32 tli;
|
||||
uint32 xlogid;
|
||||
uint32 xrecoff;
|
||||
|
||||
if (sscanf(logfname, "%08X%08X%08X",
|
||||
&tli, &xlogid, &xrecoff) != 3)
|
||||
return false;
|
||||
|
||||
xrecoff *= XLogSegSize;
|
||||
|
||||
/* Finish calculation of LSN */
|
||||
*lsn = (XLogRecPtr) ((uint64) xlogid << 32) | xrecoff;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* based on XLogFileName() in xlog_internal.h
|
||||
*/
|
||||
|
Reference in New Issue
Block a user