PostgreSQL Source Code  git master
pg_verifybackup.h File Reference
Include dependency graph for pg_verifybackup.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  manifest_file
 
struct  manifest_wal_range
 
struct  manifest_data
 
struct  verifier_context
 

Macros

#define should_verify_checksum(m)    (((m)->matched) && !((m)->bad) && (((m)->checksum_type) != CHECKSUM_TYPE_NONE))
 
#define SH_PREFIX   manifest_files
 
#define SH_ELEMENT_TYPE   manifest_file
 
#define SH_KEY_TYPE   const char *
 
#define SH_KEY   pathname
 
#define SH_HASH_KEY(tb, key)   hash_string(key)
 
#define SH_EQUAL(tb, a, b)   (strcmp(a, b) == 0)
 
#define SH_SCOPE   static inline
 
#define SH_RAW_ALLOCATOR   pg_malloc0
 
#define SH_DECLARE
 
#define SH_DEFINE
 

Typedefs

typedef struct manifest_file manifest_file
 
typedef struct manifest_wal_range manifest_wal_range
 
typedef struct manifest_data manifest_data
 
typedef struct verifier_context verifier_context
 

Functions

void report_backup_error (verifier_context *context, const char *pg_restrict fmt,...) pg_attribute_printf(2
 
void void report_fatal_error (const char *pg_restrict fmt,...) pg_attribute_printf(1
 
void void pg_attribute_noreturn ()
 
bool should_ignore_relpath (verifier_context *context, const char *relpath)
 
astreamerastreamer_verify_content_new (astreamer *next, verifier_context *context, char *archive_name, Oid tblspc_oid)
 

Macro Definition Documentation

◆ SH_DECLARE

#define SH_DECLARE

Definition at line 55 of file pg_verifybackup.h.

◆ SH_DEFINE

#define SH_DEFINE

Definition at line 56 of file pg_verifybackup.h.

◆ SH_ELEMENT_TYPE

#define SH_ELEMENT_TYPE   manifest_file

Definition at line 48 of file pg_verifybackup.h.

◆ SH_EQUAL

#define SH_EQUAL (   tb,
  a,
  b 
)    (strcmp(a, b) == 0)

Definition at line 52 of file pg_verifybackup.h.

◆ SH_HASH_KEY

#define SH_HASH_KEY (   tb,
  key 
)    hash_string(key)

Definition at line 51 of file pg_verifybackup.h.

◆ SH_KEY

#define SH_KEY   pathname

Definition at line 50 of file pg_verifybackup.h.

◆ SH_KEY_TYPE

#define SH_KEY_TYPE   const char *

Definition at line 49 of file pg_verifybackup.h.

◆ SH_PREFIX

#define SH_PREFIX   manifest_files

Definition at line 47 of file pg_verifybackup.h.

◆ SH_RAW_ALLOCATOR

#define SH_RAW_ALLOCATOR   pg_malloc0

Definition at line 54 of file pg_verifybackup.h.

◆ SH_SCOPE

#define SH_SCOPE   static inline

Definition at line 53 of file pg_verifybackup.h.

◆ should_verify_checksum

#define should_verify_checksum (   m)     (((m)->matched) && !((m)->bad) && (((m)->checksum_type) != CHECKSUM_TYPE_NONE))

Definition at line 40 of file pg_verifybackup.h.

Typedef Documentation

◆ manifest_data

typedef struct manifest_data manifest_data

◆ manifest_file

typedef struct manifest_file manifest_file

◆ manifest_wal_range

◆ verifier_context

Function Documentation

◆ astreamer_verify_content_new()

astreamer* astreamer_verify_content_new ( astreamer next,
verifier_context context,
char *  archive_name,
Oid  tblspc_oid 
)

Definition at line 66 of file astreamer_verify.c.

68 {
69  astreamer_verify *streamer;
70 
71  streamer = palloc0(sizeof(astreamer_verify));
72  *((const astreamer_ops **) &streamer->base.bbs_ops) =
74 
75  streamer->base.bbs_next = next;
76  streamer->context = context;
77  streamer->archive_name = archive_name;
78  streamer->tblspc_oid = tblspc_oid;
79 
80  if (!context->skip_checksums)
81  streamer->checksum_ctx = pg_malloc(sizeof(pg_checksum_context));
82 
83  return &streamer->base;
84 }
static const astreamer_ops astreamer_verify_ops
static int32 next
Definition: blutils.c:222
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
void * palloc0(Size size)
Definition: mcxt.c:1347
tree context
Definition: radixtree.h:1835
verifier_context * context
pg_checksum_context * checksum_ctx
const astreamer_ops * bbs_ops
Definition: astreamer.h:109
astreamer * bbs_next
Definition: astreamer.h:110

References astreamer_verify::archive_name, astreamer_verify_ops, astreamer_verify::base, astreamer::bbs_next, astreamer::bbs_ops, astreamer_verify::checksum_ctx, astreamer_verify::context, context, next, palloc0(), pg_malloc(), and astreamer_verify::tblspc_oid.

Referenced by create_archive_verifier().

◆ pg_attribute_noreturn()

void void pg_attribute_noreturn ( )

◆ report_backup_error()

void report_backup_error ( verifier_context context,
const char *pg_restrict  fmt,
  ... 
)

◆ report_fatal_error()

void void report_fatal_error ( const char *pg_restrict  fmt,
  ... 
)

◆ should_ignore_relpath()

bool should_ignore_relpath ( verifier_context context,
const char *  relpath 
)

Definition at line 1267 of file pg_verifybackup.c.

1268 {
1269  SimpleStringListCell *cell;
1270 
1271  for (cell = context->ignore_list.head; cell != NULL; cell = cell->next)
1272  {
1273  const char *r = relpath;
1274  char *v = cell->val;
1275 
1276  while (*v != '\0' && *r == *v)
1277  ++r, ++v;
1278 
1279  if (*v == '\0' && (*r == '\0' || *r == '/'))
1280  return true;
1281  }
1282 
1283  return false;
1284 }
#define relpath(rlocator, forknum)
Definition: relpath.h:102
char val[FLEXIBLE_ARRAY_MEMBER]
Definition: simple_list.h:37
struct SimpleStringListCell * next
Definition: simple_list.h:34

References context, SimpleStringListCell::next, relpath, and SimpleStringListCell::val.

Referenced by member_verify_header(), report_extra_backup_files(), verify_backup_checksums(), verify_plain_backup_directory(), and verify_tar_backup().