PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | TimeLineHistoryEntry |
Functions | |
List * | readTimeLineHistory (TimeLineID targetTLI) |
bool | existsTimeLineHistory (TimeLineID probeTLI) |
TimeLineID | findNewestTimeLine (TimeLineID startTLI) |
void | writeTimeLineHistory (TimeLineID newTLI, TimeLineID parentTLI, XLogRecPtr switchpoint, char *reason) |
void | writeTimeLineHistoryFile (TimeLineID tli, char *content, int size) |
void | restoreTimeLineHistoryFiles (TimeLineID begin, TimeLineID end) |
bool | tliInHistory (TimeLineID tli, List *expectedTLEs) |
TimeLineID | tliOfPointInHistory (XLogRecPtr ptr, List *history) |
XLogRecPtr | tliSwitchPoint (TimeLineID tli, List *history, TimeLineID *nextTLI) |
bool existsTimeLineHistory | ( | TimeLineID | probeTLI | ) |
Definition at line 222 of file timeline.c.
References AllocateFile(), ArchiveRecoveryRequested, ereport, errcode_for_file_access(), errmsg(), FATAL, fd(), FreeFile(), MAXFNAMELEN, MAXPGPATH, RestoreArchivedFile(), TLHistoryFileName(), and TLHistoryFilePath().
Referenced by findNewestTimeLine(), validateRecoveryParameters(), and WalRcvFetchTimeLineHistoryFiles().
TimeLineID findNewestTimeLine | ( | TimeLineID | startTLI | ) |
Definition at line 264 of file timeline.c.
References existsTimeLineHistory().
Referenced by rescanLatestTimeLine(), StartupXLOG(), and validateRecoveryParameters().
List* readTimeLineHistory | ( | TimeLineID | targetTLI | ) |
Definition at line 76 of file timeline.c.
References AllocateFile(), ArchiveRecoveryRequested, TimeLineHistoryEntry::begin, TimeLineHistoryEntry::end, ereport, errcode_for_file_access(), errhint(), errmsg(), ERROR, FATAL, fd(), FreeFile(), InvalidXLogRecPtr, KeepFileRestoredFromArchive(), lcons(), list_make1, MAXFNAMELEN, MAXPGPATH, NIL, palloc(), pgstat_report_wait_end(), pgstat_report_wait_start(), res, RestoreArchivedFile(), TLHistoryFileName(), TLHistoryFilePath(), and TimeLineHistoryEntry::tli.
Referenced by AddWALInfoToBackupManifest(), GetOldestUnsummarizedLSN(), PrepareForIncrementalBackup(), ReadReplicationSlot(), rescanLatestTimeLine(), StartReplication(), summarizer_read_local_xlog_page(), WaitForWALToBecomeAvailable(), WalSummarizerMain(), XLogFileReadAnyTLI(), XLogReadDetermineTimeline(), and XLogSendPhysical().
void restoreTimeLineHistoryFiles | ( | TimeLineID | begin, |
TimeLineID | end | ||
) |
Definition at line 50 of file timeline.c.
References KeepFileRestoredFromArchive(), MAXFNAMELEN, MAXPGPATH, RestoreArchivedFile(), and TLHistoryFileName().
Referenced by rescanLatestTimeLine(), and StartupXLOG().
bool tliInHistory | ( | TimeLineID | tli, |
List * | expectedTLEs | ||
) |
Definition at line 526 of file timeline.c.
References expectedTLEs, and lfirst.
Referenced by checkTimeLineSwitch(), and ReadRecord().
TimeLineID tliOfPointInHistory | ( | XLogRecPtr | ptr, |
List * | history | ||
) |
Definition at line 544 of file timeline.c.
References TimeLineHistoryEntry::begin, elog, TimeLineHistoryEntry::end, ERROR, lfirst, TimeLineHistoryEntry::tli, and XLogRecPtrIsInvalid.
Referenced by InitWalRecovery(), ReadReplicationSlot(), WaitForWALToBecomeAvailable(), and XLogReadDetermineTimeline().
XLogRecPtr tliSwitchPoint | ( | TimeLineID | tli, |
List * | history, | ||
TimeLineID * | nextTLI | ||
) |
Definition at line 572 of file timeline.c.
References TimeLineHistoryEntry::end, ereport, errmsg(), ERROR, InvalidXLogRecPtr, lfirst, and TimeLineHistoryEntry::tli.
Referenced by InitWalRecovery(), StartReplication(), summarizer_read_local_xlog_page(), WalSummarizerMain(), XLogReadDetermineTimeline(), and XLogSendPhysical().
void writeTimeLineHistory | ( | TimeLineID | newTLI, |
TimeLineID | parentTLI, | ||
XLogRecPtr | switchpoint, | ||
char * | reason | ||
) |
Definition at line 304 of file timeline.c.
References ArchiveRecoveryRequested, Assert, CloseTransientFile(), data_sync_elevel(), durable_rename(), ereport, errcode_for_file_access(), errmsg(), ERROR, fd(), LSN_FORMAT_ARGS, MAXFNAMELEN, MAXPGPATH, OpenTransientFile(), pg_fsync(), pgstat_report_wait_end(), pgstat_report_wait_start(), read, RestoreArchivedFile(), snprintf, TLHistoryFileName(), TLHistoryFilePath(), write, XLogArchiveNotify(), XLogArchivingActive, and XLOGDIR.
Referenced by StartupXLOG().
void writeTimeLineHistoryFile | ( | TimeLineID | tli, |
char * | content, | ||
int | size | ||
) |
Definition at line 463 of file timeline.c.
References CloseTransientFile(), data_sync_elevel(), durable_rename(), ereport, errcode_for_file_access(), errmsg(), ERROR, fd(), MAXPGPATH, OpenTransientFile(), pg_fsync(), pgstat_report_wait_end(), pgstat_report_wait_start(), size, snprintf, TLHistoryFilePath(), write, and XLOGDIR.
Referenced by WalRcvFetchTimeLineHistoryFiles().