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 "miscadmin.h"
#include "postmaster/startup.h"
#include "replication/walsender.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "storage/lwlock.h"
#include "storage/pmsignal.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) |
void | KeepFileRestoredFromArchive (const char *path, const char *xlogfname) |
void | XLogArchiveNotify (const char *xlog) |
void | XLogArchiveNotifySeg (XLogSegNo segno) |
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 | ||
) |
Definition at line 287 of file xlogarchive.c.
References Assert, DEBUG3, ereport, errmsg(), errmsg_internal(), FATAL, GetOldestRestartPoint(), MAXPGPATH, strlcpy(), wait_result_is_any_signal(), wait_result_to_str(), wal_segment_size, WARNING, XLByteToSeg, and XLogFileName.
Referenced by CreateRestartPoint(), and StartupXLOG().
void KeepFileRestoredFromArchive | ( | const char * | path, |
const char * | xlogfname | ||
) |
Definition at line 381 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 53 of file xlogarchive.c.
References ArchiveRecoveryRequested, Assert, BuildRestoreCommand(), DEBUG1, DEBUG2, DEBUG3, elevel, elog, ereport, errcode_for_file_access(), errdetail(), errmsg(), errmsg_internal(), ERROR, FATAL, GetOldestRestartPoint(), LOG, MAXPGPATH, pfree(), 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 572 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 719 of file xlogarchive.c.
References MAXPGPATH, and StatusFilePath.
Referenced by CleanupBackupHistory(), exitArchiveRecovery(), RemoveXlogFile(), and StartupXLOG().
void XLogArchiveForceDone | ( | const char * | xlog | ) |
Definition at line 517 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 XLogWalRcvWrite().
bool XLogArchiveIsBusy | ( | const char * | xlog | ) |
Definition at line 626 of file xlogarchive.c.
References MAXPGPATH, snprintf, stat, StatusFilePath, and XLOGDIR.
Referenced by do_pg_stop_backup().
bool XLogArchiveIsReady | ( | const char * | xlog | ) |
Definition at line 701 of file xlogarchive.c.
References MAXPGPATH, stat, and StatusFilePath.
Referenced by RemoveNonParentXlogFiles().
bool XLogArchiveIsReadyOrDone | ( | const char * | xlog | ) |
Definition at line 671 of file xlogarchive.c.
References MAXPGPATH, stat, and StatusFilePath.
Referenced by StartupXLOG().
void XLogArchiveNotify | ( | const char * | xlog | ) |
Definition at line 467 of file xlogarchive.c.
References AllocateFile(), ereport, errcode_for_file_access(), errmsg(), fd(), FreeFile(), IsUnderPostmaster, LOG, MAXPGPATH, PMSIGNAL_WAKEN_ARCHIVER, SendPostmasterSignal(), and StatusFilePath.
Referenced by KeepFileRestoredFromArchive(), StartupXLOG(), WalRcvFetchTimeLineHistoryFiles(), WalReceiverMain(), writeTimeLineHistory(), XLogArchiveCheckDone(), XLogArchiveNotifySeg(), and XLogWalRcvWrite().
void XLogArchiveNotifySeg | ( | XLogSegNo | segno | ) |
Definition at line 501 of file xlogarchive.c.
References MAXFNAMELEN, ThisTimeLineID, wal_segment_size, XLogArchiveNotify(), and XLogFileName.
Referenced by XLogWrite().