1
0
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:
Michael Paquier
2013-12-10 17:27:51 +09:00
parent 71d019ce56
commit 8aa6b84b98
3 changed files with 23 additions and 40 deletions

18
xlog.c
View File

@ -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
*/