PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <sys/stat.h>
#include <sys/wait.h>
#include <signal.h>
#include <unistd.h>
#include "access/xlog.h"
#include "access/xlog_internal.h"
#include "access/xlogarchive.h"
#include "common/archive.h"
#include "common/percentrepl.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "postmaster/pgarch.h"
#include "postmaster/startup.h"
#include "replication/walsender.h"
#include "storage/fd.h"
#include "storage/ipc.h"
Go to the source code of this file.
Functions | |
bool | RestoreArchivedFile (char *path, const char *xlogfname, const char *recovername, off_t expectedSize, bool cleanupEnabled) |
void | ExecuteRecoveryCommand (const char *command, const char *commandName, bool failOnSignal, uint32 wait_event_info) |
void | KeepFileRestoredFromArchive (const char *path, const char *xlogfname) |
void | XLogArchiveNotify (const char *xlog) |
void | XLogArchiveNotifySeg (XLogSegNo segno, TimeLineID tli) |
void | XLogArchiveForceDone (const char *xlog) |
bool | XLogArchiveCheckDone (const char *xlog) |
bool | XLogArchiveIsBusy (const char *xlog) |
bool | XLogArchiveIsReadyOrDone (const char *xlog) |
bool | XLogArchiveIsReady (const char *xlog) |
void | XLogArchiveCleanup (const char *xlog) |
void ExecuteRecoveryCommand | ( | const char * | command, |
const char * | commandName, | ||
bool | failOnSignal, | ||
uint32 | wait_event_info | ||
) |
Definition at line 295 of file xlogarchive.c.
References Assert, DEBUG3, ereport, errmsg(), errmsg_internal(), FATAL, fflush(), GetOldestRestartPoint(), MAXPGPATH, pfree(), pgstat_report_wait_end(), pgstat_report_wait_start(), replace_percent_placeholders(), wait_result_is_any_signal(), wait_result_to_str(), wal_segment_size, WARNING, XLByteToSeg, and XLogFileName().
Referenced by CleanupAfterArchiveRecovery(), and CreateRestartPoint().
void KeepFileRestoredFromArchive | ( | const char * | path, |
const char * | xlogfname | ||
) |
Definition at line 358 of file xlogarchive.c.
References ARCHIVE_MODE_ALWAYS, durable_rename(), ereport, errcode_for_file_access(), errmsg(), ERROR, FATAL, MAXPGPATH, snprintf, stat, strlcpy(), WalSndRqstFileReload(), WalSndWakeup(), XLogArchiveForceDone(), XLogArchiveMode, XLogArchiveNotify(), XLOGDIR, and xlogfpath.
Referenced by readTimeLineHistory(), restoreTimeLineHistoryFiles(), and XLogFileRead().
bool RestoreArchivedFile | ( | char * | path, |
const char * | xlogfname, | ||
const char * | recovername, | ||
off_t | expectedSize, | ||
bool | cleanupEnabled | ||
) |
Definition at line 54 of file xlogarchive.c.
References ArchiveRecoveryRequested, Assert, BuildRestoreCommand(), DEBUG1, DEBUG2, DEBUG3, ereport, errcode_for_file_access(), errdetail(), errmsg(), errmsg_internal(), FATAL, fflush(), GetOldestRestartPoint(), LOG, MAXPGPATH, pfree(), pgstat_report_wait_end(), pgstat_report_wait_start(), PostRestoreCommand(), PreRestoreCommand(), proc_exit(), recoveryRestoreCommand, snprintf, stat::st_size, StandbyMode, stat, wait_result_is_any_signal(), wait_result_is_signal(), wait_result_to_str(), wal_segment_size, XLByteToSeg, XLOGDIR, and XLogFileName().
Referenced by existsTimeLineHistory(), readTimeLineHistory(), restoreTimeLineHistoryFiles(), SimpleXLogPageRead(), writeTimeLineHistory(), and XLogFileRead().
bool XLogArchiveCheckDone | ( | const char * | xlog | ) |
Definition at line 565 of file xlogarchive.c.
References GetRecoveryState(), MAXPGPATH, RECOVERY_STATE_ARCHIVE, stat, StatusFilePath(), XLogArchiveNotify(), XLogArchivingActive, and XLogArchivingAlways.
Referenced by CleanupBackupHistory(), and RemoveOldXlogFiles().
void XLogArchiveCleanup | ( | const char * | xlog | ) |
Definition at line 712 of file xlogarchive.c.
References MAXPGPATH, and StatusFilePath().
Referenced by CleanupAfterArchiveRecovery(), CleanupBackupHistory(), RemoveXlogFile(), and XLogInitNewTimeline().
void XLogArchiveForceDone | ( | const char * | xlog | ) |
Definition at line 510 of file xlogarchive.c.
References AllocateFile(), durable_rename(), ereport, errcode_for_file_access(), errmsg(), fd(), FreeFile(), LOG, MAXPGPATH, stat, StatusFilePath(), and WARNING.
Referenced by KeepFileRestoredFromArchive(), WalRcvFetchTimeLineHistoryFiles(), WalReceiverMain(), and XLogWalRcvClose().
bool XLogArchiveIsBusy | ( | const char * | xlog | ) |
Definition at line 619 of file xlogarchive.c.
References MAXPGPATH, snprintf, stat, StatusFilePath(), and XLOGDIR.
Referenced by do_pg_backup_stop().
bool XLogArchiveIsReady | ( | const char * | xlog | ) |
Definition at line 694 of file xlogarchive.c.
References MAXPGPATH, stat, and StatusFilePath().
Referenced by RemoveNonParentXlogFiles().
bool XLogArchiveIsReadyOrDone | ( | const char * | xlog | ) |
Definition at line 664 of file xlogarchive.c.
References MAXPGPATH, stat, and StatusFilePath().
Referenced by CleanupAfterArchiveRecovery().
void XLogArchiveNotify | ( | const char * | xlog | ) |
Definition at line 444 of file xlogarchive.c.
References AllocateFile(), ereport, errcode_for_file_access(), errmsg(), fd(), FreeFile(), IsTLHistoryFileName(), IsUnderPostmaster, LOG, MAXPGPATH, PgArchForceDirScan(), PgArchWakeup(), and StatusFilePath().
Referenced by CleanupAfterArchiveRecovery(), KeepFileRestoredFromArchive(), WalRcvFetchTimeLineHistoryFiles(), WalReceiverMain(), writeTimeLineHistory(), XLogArchiveCheckDone(), XLogArchiveNotifySeg(), and XLogWalRcvClose().
void XLogArchiveNotifySeg | ( | XLogSegNo | segno, |
TimeLineID | tli | ||
) |
Definition at line 492 of file xlogarchive.c.
References Assert, MAXFNAMELEN, wal_segment_size, XLogArchiveNotify(), and XLogFileName().
Referenced by XLogWrite().