backup_manifest.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*-------------------------------------------------------------------------
  2. *
  3. * backup_manifest.h
  4. * Routines for generating a backup manifest.
  5. *
  6. * Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
  7. *
  8. * src/include/backup/backup_manifest.h
  9. *
  10. *-------------------------------------------------------------------------
  11. */
  12. #ifndef BACKUP_MANIFEST_H
  13. #define BACKUP_MANIFEST_H
  14. #include "backup/basebackup_sink.h"
  15. #include "common/checksum_helper.h"
  16. #include "pgtime.h"
  17. #include "storage/buffile.h"
  18. typedef enum manifest_option
  19. {
  20. MANIFEST_OPTION_YES,
  21. MANIFEST_OPTION_NO,
  22. MANIFEST_OPTION_FORCE_ENCODE
  23. } backup_manifest_option;
  24. typedef struct backup_manifest_info
  25. {
  26. BufFile *buffile;
  27. pg_checksum_type checksum_type;
  28. pg_cryptohash_ctx *manifest_ctx;
  29. uint64 manifest_size;
  30. bool force_encode;
  31. bool first_file;
  32. bool still_checksumming;
  33. } backup_manifest_info;
  34. extern void InitializeBackupManifest(backup_manifest_info *manifest,
  35. backup_manifest_option want_manifest,
  36. pg_checksum_type manifest_checksum_type);
  37. extern void AddFileToBackupManifest(backup_manifest_info *manifest,
  38. const char *spcoid,
  39. const char *pathname, size_t size,
  40. pg_time_t mtime,
  41. pg_checksum_context *checksum_ctx);
  42. extern void AddWALInfoToBackupManifest(backup_manifest_info *manifest,
  43. XLogRecPtr startptr,
  44. TimeLineID starttli, XLogRecPtr endptr,
  45. TimeLineID endtli);
  46. extern void SendBackupManifest(backup_manifest_info *manifest, bbsink *sink);
  47. extern void FreeBackupManifest(backup_manifest_info *manifest);
  48. #endif