|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/timeline.h"#include "access/xlog.h"#include "backup/backup_manifest.h"#include "backup/basebackup_sink.h"#include "common/relpath.h"#include "mb/pg_wchar.h"#include "utils/builtins.h"#include "utils/json.h"
Go to the source code of this file.
Macros | |
| #define | AppendToManifest(manifest, ...) |
Functions | |
| static void | AppendStringToManifest (backup_manifest_info *manifest, const char *s) |
| static bool | IsManifestEnabled (backup_manifest_info *manifest) |
| void | InitializeBackupManifest (backup_manifest_info *manifest, backup_manifest_option want_manifest, pg_checksum_type manifest_checksum_type) |
| void | FreeBackupManifest (backup_manifest_info *manifest) |
| void | AddFileToBackupManifest (backup_manifest_info *manifest, Oid 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) |
| #define AppendToManifest | ( | manifest, | |
| ... | |||
| ) |
Definition at line 42 of file backup_manifest.c.
| void AddFileToBackupManifest | ( | backup_manifest_info * | manifest, |
| Oid | spcoid, | ||
| const char * | pathname, | ||
| size_t | size, | ||
| pg_time_t | mtime, | ||
| pg_checksum_context * | checksum_ctx | ||
| ) |
Definition at line 102 of file backup_manifest.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), AppendStringToManifest(), buf, CHECKSUM_TYPE_NONE, elog, enlargeStringInfo(), ERROR, escape_json_with_len(), hex_encode(), initStringInfo(), IsManifestEnabled(), manifest, MAXPGPATH, OidIsValid, pfree(), pg_checksum_final(), PG_CHECKSUM_MAX_LENGTH, pg_checksum_type_name(), pg_gmtime(), pg_strftime(), PG_TBLSPC_DIR, 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 213 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 XLogRecPtrIsValid.
Referenced by perform_base_backup().
|
static |
Definition at line 384 of file backup_manifest.c.
References Assert(), BufFileWrite(), elog, ERROR, len, manifest, pg_cryptohash_error(), and pg_cryptohash_update().
Referenced by AddFileToBackupManifest(), AddWALInfoToBackupManifest(), and SendBackupManifest().
| void FreeBackupManifest | ( | backup_manifest_info * | manifest | ) |
Definition at line 92 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, GetSystemIdentifier(), manifest, MANIFEST_OPTION_FORCE_ENCODE, MANIFEST_OPTION_NO, pg_cryptohash_create(), pg_cryptohash_error(), pg_cryptohash_init(), PG_SHA256, UINT64_FORMAT, and UINT64CONST.
Referenced by perform_base_backup().
|
inlinestatic |
Definition at line 34 of file backup_manifest.c.
References manifest.
Referenced by AddFileToBackupManifest(), AddWALInfoToBackupManifest(), and SendBackupManifest().
| void SendBackupManifest | ( | backup_manifest_info * | manifest, |
| bbsink * | sink | ||
| ) |
Definition at line 317 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().