PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <sys/stat.h>
#include <unistd.h>
#include "access/xlog_internal.h"
#include "backup/walsummary.h"
#include "common/int.h"
#include "utils/wait_event.h"
Go to the source code of this file.
Functions | |
static bool | IsWalSummaryFilename (char *filename) |
static int | ListComparatorForWalSummaryFiles (const ListCell *a, const ListCell *b) |
List * | GetWalSummaries (TimeLineID tli, XLogRecPtr start_lsn, XLogRecPtr end_lsn) |
List * | FilterWalSummaries (List *wslist, TimeLineID tli, XLogRecPtr start_lsn, XLogRecPtr end_lsn) |
bool | WalSummariesAreComplete (List *wslist, XLogRecPtr start_lsn, XLogRecPtr end_lsn, XLogRecPtr *missing_lsn) |
File | OpenWalSummaryFile (WalSummaryFile *ws, bool missing_ok) |
void | RemoveWalSummaryIfOlderThan (WalSummaryFile *ws, time_t cutoff_time) |
int | ReadWalSummary (void *wal_summary_io, void *data, int length) |
int | WriteWalSummary (void *wal_summary_io, void *data, int length) |
void | ReportWalSummaryError (void *callback_arg, char *fmt,...) |
List* FilterWalSummaries | ( | List * | wslist, |
TimeLineID | tli, | ||
XLogRecPtr | start_lsn, | ||
XLogRecPtr | end_lsn | ||
) |
Definition at line 100 of file walsummary.c.
References WalSummaryFile::end_lsn, lappend(), lfirst, NIL, WalSummaryFile::tli, and XLogRecPtrIsInvalid.
Referenced by PrepareForIncrementalBackup().
List* GetWalSummaries | ( | TimeLineID | tli, |
XLogRecPtr | start_lsn, | ||
XLogRecPtr | end_lsn | ||
) |
Definition at line 43 of file walsummary.c.
References AllocateDir(), dirent::d_name, WalSummaryFile::end_lsn, FreeDir(), IsWalSummaryFilename(), lappend(), NIL, palloc(), ReadDir(), WalSummaryFile::start_lsn, WalSummaryFile::tli, XLOGDIR, and XLogRecPtrIsInvalid.
Referenced by GetOldestUnsummarizedLSN(), MaybeRemoveOldWalSummaries(), pg_available_wal_summaries(), and PrepareForIncrementalBackup().
|
static |
Definition at line 347 of file walsummary.c.
References a, b, lfirst, pg_cmp_u64(), and WalSummaryFile::start_lsn.
Referenced by WalSummariesAreComplete().
File OpenWalSummaryFile | ( | WalSummaryFile * | ws, |
bool | missing_ok | ||
) |
Definition at line 205 of file walsummary.c.
References WalSummaryFile::end_lsn, ereport, errcode_for_file_access(), errmsg(), ERROR, LSN_FORMAT_ARGS, MAXPGPATH, PathNameOpenFile(), snprintf, WalSummaryFile::start_lsn, WalSummaryFile::tli, and XLOGDIR.
Referenced by pg_wal_summary_contents(), and PrepareForIncrementalBackup().
int ReadWalSummary | ( | void * | wal_summary_io, |
void * | data, | ||
int | length | ||
) |
Definition at line 273 of file walsummary.c.
References data, ereport, errcode_for_file_access(), errmsg(), ERROR, WalSummaryIO::file, FilePathName(), WalSummaryIO::filepos, and FileRead().
Referenced by pg_wal_summary_contents(), and PrepareForIncrementalBackup().
void RemoveWalSummaryIfOlderThan | ( | WalSummaryFile * | ws, |
time_t | cutoff_time | ||
) |
Definition at line 230 of file walsummary.c.
References DEBUG2, WalSummaryFile::end_lsn, ereport, errcode_for_file_access(), errmsg(), errmsg_internal(), ERROR, LSN_FORMAT_ARGS, lstat, MAXPGPATH, snprintf, stat::st_mtime, WalSummaryFile::start_lsn, WalSummaryFile::tli, and XLOGDIR.
Referenced by MaybeRemoveOldWalSummaries().
void ReportWalSummaryError | ( | void * | callback_arg, |
char * | fmt, | ||
... | |||
) |
Definition at line 322 of file walsummary.c.
References appendStringInfoVA(), buf, enlargeStringInfo(), ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg_internal(), ERROR, fmt, initStringInfo(), va_end(), and va_start().
Referenced by pg_wal_summary_contents(), and PrepareForIncrementalBackup().
bool WalSummariesAreComplete | ( | List * | wslist, |
XLogRecPtr | start_lsn, | ||
XLogRecPtr | end_lsn, | ||
XLogRecPtr * | missing_lsn | ||
) |
Definition at line 138 of file walsummary.c.
References WalSummaryFile::end_lsn, InvalidXLogRecPtr, lfirst, list_copy(), list_sort(), ListComparatorForWalSummaryFiles(), NIL, and WalSummaryFile::start_lsn.
Referenced by PrepareForIncrementalBackup().
int WriteWalSummary | ( | void * | wal_summary_io, |
void * | data, | ||
int | length | ||
) |
Definition at line 294 of file walsummary.c.
References data, ereport, errcode_for_file_access(), errhint(), errmsg(), ERROR, WalSummaryIO::file, FilePathName(), WalSummaryIO::filepos, and FileWrite().
Referenced by SummarizeWAL().