PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <unistd.h>
#include "access/rmgr.h"
#include "access/xact.h"
#include "access/xlog_internal.h"
#include "access/xlogreader.h"
#include "catalog/pg_control.h"
#include "catalog/storage_xlog.h"
#include "commands/dbcommands_xlog.h"
#include "fe_utils/archive.h"
#include "filemap.h"
#include "pg_rewind.h"
#include "access/rmgrlist.h"
Go to the source code of this file.
Data Structures | |
struct | XLogPageReadPrivate |
Macros | |
#define | PG_RMGR(symname, name, redo, desc, identify, startup, cleanup, mask, decode) name, |
#define | RmgrName(rmid) |
Typedefs | |
typedef struct XLogPageReadPrivate | XLogPageReadPrivate |
Functions | |
static void | extractPageInfo (XLogReaderState *record) |
static int | SimpleXLogPageRead (XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, int reqLen, XLogRecPtr targetRecPtr, char *readBuf) |
void | extractPageMap (const char *datadir, XLogRecPtr startpoint, int tliIndex, XLogRecPtr endpoint, const char *restoreCommand) |
XLogRecPtr | readOneRecord (const char *datadir, XLogRecPtr ptr, int tliIndex, const char *restoreCommand) |
void | findLastCheckpoint (const char *datadir, XLogRecPtr forkptr, int tliIndex, XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli, XLogRecPtr *lastchkptredo, const char *restoreCommand) |
Variables | |
static const char *const | RmgrNames [RM_MAX_ID+1] |
static int | xlogreadfd = -1 |
static XLogSegNo | xlogreadsegno = 0 |
static char | xlogfpath [MAXPGPATH] |
Definition at line 31 of file parsexlog.c.
#define RmgrName | ( | rmid | ) |
Definition at line 38 of file parsexlog.c.
typedef struct XLogPageReadPrivate XLogPageReadPrivate |
|
static |
Definition at line 368 of file parsexlog.c.
References LSN_FORMAT_ARGS, MAIN_FORKNUM, pg_fatal, process_target_wal_block_change(), XLogReaderState::ReadRecPtr, RmgrName, XLOG_DBASE_CREATE_FILE_COPY, XLOG_DBASE_CREATE_WAL_LOG, XLOG_DBASE_DROP, XLOG_SMGR_CREATE, XLOG_SMGR_TRUNCATE, XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_OPMASK, XLogRecGetBlockTagExtended(), XLogRecGetInfo, XLogRecGetRmid, XLogRecMaxBlockId, XLR_INFO_MASK, and XLR_SPECIAL_REL_UPDATE.
Referenced by extractPageMap().
void extractPageMap | ( | const char * | datadir, |
XLogRecPtr | startpoint, | ||
int | tliIndex, | ||
XLogRecPtr | endpoint, | ||
const char * | restoreCommand | ||
) |
Definition at line 66 of file parsexlog.c.
References close, datadir, XLogReaderState::EndRecPtr, extractPageInfo(), LSN_FORMAT_ARGS, pg_fatal, SimpleXLogPageRead(), XLogPageReadPrivate::tliIndex, WalSegSz, XL_ROUTINE, XLogBeginRead(), xlogreader, XLogReaderAllocate(), XLogReaderFree(), xlogreadfd, and XLogReadRecord().
Referenced by main().
void findLastCheckpoint | ( | const char * | datadir, |
XLogRecPtr | forkptr, | ||
int | tliIndex, | ||
XLogRecPtr * | lastchkptrec, | ||
TimeLineID * | lastchkpttli, | ||
XLogRecPtr * | lastchkptredo, | ||
const char * | restoreCommand | ||
) |
Definition at line 168 of file parsexlog.c.
References close, datadir, LSN_FORMAT_ARGS, pg_fatal, CheckPoint::redo, SimpleXLogPageRead(), SizeOfXLogLongPHD, SizeOfXLogShortPHD, CheckPoint::ThisTimeLineID, WalSegSz, XLogRecord::xl_prev, XL_ROUTINE, XLOG_CHECKPOINT_ONLINE, XLOG_CHECKPOINT_SHUTDOWN, XLogBeginRead(), xlogreader, XLogReaderAllocate(), XLogReaderFree(), xlogreadfd, XLogReadRecord(), XLogRecGetData, XLogRecGetInfo, XLogRecGetRmid, XLogSegmentOffset, and XLR_INFO_MASK.
Referenced by main().
XLogRecPtr readOneRecord | ( | const char * | datadir, |
XLogRecPtr | ptr, | ||
int | tliIndex, | ||
const char * | restoreCommand | ||
) |
Definition at line 124 of file parsexlog.c.
References close, datadir, XLogReaderState::EndRecPtr, LSN_FORMAT_ARGS, pg_fatal, SimpleXLogPageRead(), XLogPageReadPrivate::tliIndex, WalSegSz, XL_ROUTINE, XLogBeginRead(), xlogreader, XLogReaderAllocate(), XLogReaderFree(), xlogreadfd, and XLogReadRecord().
Referenced by main().
|
static |
Definition at line 254 of file parsexlog.c.
References Assert, TimeLineHistoryEntry::begin, close, TimeLineHistoryEntry::end, MAXFNAMELEN, MAXPGPATH, PG_BINARY, pg_log_debug, pg_log_error, XLogReaderState::private_data, read, RestoreArchivedFile(), XLogReaderState::seg, XLogReaderState::segcxt, snprintf, targetHistory, targetNentries, TimeLineHistoryEntry::tli, WalSegSz, WALSegmentContext::ws_dir, WALOpenSegment::ws_tli, XLByteInSeg, XLByteToSeg, XLOGDIR, XLogFileName(), xlogfpath, xlogreader, xlogreadfd, xlogreadsegno, XLogSegmentOffset, and XLogSegNoOffsetToRecPtr.
Referenced by extractPageMap(), findLastCheckpoint(), and readOneRecord().
|
static |
Definition at line 34 of file parsexlog.c.
|
static |
Definition at line 45 of file parsexlog.c.
Referenced by KeepFileRestoredFromArchive(), and SimpleXLogPageRead().
|
static |
Definition at line 43 of file parsexlog.c.
Referenced by extractPageMap(), findLastCheckpoint(), readOneRecord(), and SimpleXLogPageRead().
|
static |
Definition at line 44 of file parsexlog.c.
Referenced by SimpleXLogPageRead().