diff options
| author | Robert Haas | 2020-04-20 18:37:38 +0000 |
|---|---|---|
| committer | Robert Haas | 2020-04-20 18:38:15 +0000 |
| commit | 079ac29d4dafe581748ceca523aa90c8ce8b035b (patch) | |
| tree | faea197d48cb19eb5a6334374421bf5db6a4f77a /src/include | |
| parent | 1e324cb0e7613dc035a403c4201c7dc004e7dedb (diff) | |
Move the server's backup manifest code to a separate file.
basebackup.c is already a pretty big and complicated file, so it
makes more sense to keep the backup manifest support routines
in a separate file, for clarity and ease of maintenance.
Discussion: http://postgr.es/m/CA+TgmoavRak5OdP76P8eJExDYhPEKWjMb0sxW7dF01dWFgE=uA@mail.gmail.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/replication/backup_manifest.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/include/replication/backup_manifest.h b/src/include/replication/backup_manifest.h new file mode 100644 index 00000000000..e7fccddd0da --- /dev/null +++ b/src/include/replication/backup_manifest.h @@ -0,0 +1,51 @@ +/*------------------------------------------------------------------------- + * + * backup_manifest.h + * Routines for generating a backup manifest. + * + * Portions Copyright (c) 2010-2020, PostgreSQL Global Development Group + * + * src/include/replication/backup_manifest.h + * + *------------------------------------------------------------------------- + */ +#ifndef BACKUP_MANIFEST_H +#define BACKUP_MANIFEST_H + +#include "access/xlogdefs.h" +#include "common/checksum_helper.h" +#include "pgtime.h" +#include "storage/buffile.h" + +typedef enum manifest_option +{ + MANIFEST_OPTION_YES, + MANIFEST_OPTION_NO, + MANIFEST_OPTION_FORCE_ENCODE +} manifest_option; + +typedef struct manifest_info +{ + BufFile *buffile; + pg_checksum_type checksum_type; + pg_sha256_ctx manifest_ctx; + uint64 manifest_size; + bool force_encode; + bool first_file; + bool still_checksumming; +} manifest_info; + +extern void InitializeManifest(manifest_info *manifest, + manifest_option want_manifest, + pg_checksum_type manifest_checksum_type); +extern void AppendStringToManifest(manifest_info *manifest, char *s); +extern void AddFileToManifest(manifest_info *manifest, const char *spcoid, + const char *pathname, size_t size, + pg_time_t mtime, + pg_checksum_context *checksum_ctx); +extern void AddWALInfoToManifest(manifest_info *manifest, XLogRecPtr startptr, + TimeLineID starttli, XLogRecPtr endptr, + TimeLineID endtli); +extern void SendBackupManifest(manifest_info *manifest); + +#endif |
