PostgreSQL Source Code
git master
|
#include "backup/basebackup_sink.h"
#include "common/checksum_helper.h"
#include "pgtime.h"
#include "storage/buffile.h"
Go to the source code of this file.
Data Structures | |
struct | backup_manifest_info |
Typedefs | |
typedef enum manifest_option | backup_manifest_option |
typedef struct backup_manifest_info | backup_manifest_info |
Enumerations | |
enum | manifest_option { MANIFEST_OPTION_YES , MANIFEST_OPTION_NO , MANIFEST_OPTION_FORCE_ENCODE } |
Functions | |
void | InitializeBackupManifest (backup_manifest_info *manifest, backup_manifest_option want_manifest, pg_checksum_type manifest_checksum_type) |
void | AddFileToBackupManifest (backup_manifest_info *manifest, const char *spcoid, const char *pathname, size_t size, pg_time_t mtime, pg_checksum_context *checksum_ctx) |
void | AddWALInfoToBackupManifest (backup_manifest_info *manifest, XLogRecPtr startptr, TimeLineID starttli, XLogRecPtr endptr, TimeLineID endtli) |
void | SendBackupManifest (backup_manifest_info *manifest, bbsink *sink) |
void | FreeBackupManifest (backup_manifest_info *manifest) |
typedef struct backup_manifest_info backup_manifest_info |
typedef enum manifest_option backup_manifest_option |
enum manifest_option |
Enumerator | |
---|---|
MANIFEST_OPTION_YES | |
MANIFEST_OPTION_NO | |
MANIFEST_OPTION_FORCE_ENCODE |
Definition at line 20 of file backup_manifest.h.
void AddFileToBackupManifest | ( | backup_manifest_info * | manifest, |
const char * | spcoid, | ||
const char * | pathname, | ||
size_t | size, | ||
pg_time_t | mtime, | ||
pg_checksum_context * | checksum_ctx | ||
) |
Definition at line 100 of file backup_manifest.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), AppendStringToManifest(), buf, CHECKSUM_TYPE_NONE, elog(), enlargeStringInfo(), ERROR, escape_json(), hex_encode(), initStringInfo(), IsManifestEnabled(), manifest, MAXPGPATH, pfree(), pg_checksum_final(), PG_CHECKSUM_MAX_LENGTH, pg_checksum_type_name(), pg_gmtime(), pg_strftime(), PG_UTF8, pg_verify_mbstr(), snprintf, and pg_checksum_context::type.
Referenced by sendFile(), and sendFileWithContent().
void AddWALInfoToBackupManifest | ( | backup_manifest_info * | manifest, |
XLogRecPtr | startptr, | ||
TimeLineID | starttli, | ||
XLogRecPtr | endptr, | ||
TimeLineID | endtli | ||
) |
Definition at line 211 of file backup_manifest.c.
References AppendStringToManifest(), AppendToManifest, TimeLineHistoryEntry::begin, TimeLineHistoryEntry::end, ereport, errmsg(), ERROR, IsManifestEnabled(), lfirst, LSN_FORMAT_ARGS, manifest, readTimeLineHistory(), TimeLineHistoryEntry::tli, and XLogRecPtrIsInvalid.
Referenced by perform_base_backup().
void FreeBackupManifest | ( | backup_manifest_info * | manifest | ) |
Definition at line 90 of file backup_manifest.c.
References manifest, and pg_cryptohash_free().
Referenced by perform_base_backup().
void InitializeBackupManifest | ( | backup_manifest_info * | manifest, |
backup_manifest_option | want_manifest, | ||
pg_checksum_type | manifest_checksum_type | ||
) |
Definition at line 57 of file backup_manifest.c.
References AppendToManifest, BufFileCreateTemp(), elog(), ERROR, manifest, MANIFEST_OPTION_FORCE_ENCODE, MANIFEST_OPTION_NO, pg_cryptohash_create(), pg_cryptohash_error(), pg_cryptohash_init(), and PG_SHA256.
Referenced by perform_base_backup().
void SendBackupManifest | ( | backup_manifest_info * | manifest, |
bbsink * | sink | ||
) |
Definition at line 315 of file backup_manifest.c.
References AppendStringToManifest(), bbsink::bbs_buffer, bbsink::bbs_buffer_length, bbsink_begin_manifest(), bbsink_end_manifest(), bbsink_manifest_contents(), BufFileClose(), BufFileReadExact(), BufFileSeek(), elog(), ereport, errcode_for_file_access(), errmsg(), ERROR, hex_encode(), IsManifestEnabled(), manifest, Min, pg_cryptohash_error(), pg_cryptohash_final(), PG_SHA256_DIGEST_LENGTH, and PG_SHA256_DIGEST_STRING_LENGTH.
Referenced by perform_base_backup().