|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <unistd.h>#include "backup/basebackup_incremental.h"#include "common/file_perm.h"#include "common/logging.h"#include "copy_file.h"#include "lib/stringinfo.h"#include "reconstruct.h"#include "storage/block.h"
Go to the source code of this file.
Data Structures | |
| struct | rfile |
Typedefs | |
| typedef struct rfile | rfile |
Functions | |
| static void | debug_reconstruction (int n_source, rfile **sources, bool dry_run) |
| static unsigned | find_reconstructed_block_length (rfile *s) |
| static rfile * | make_incremental_rfile (char *filename) |
| static rfile * | make_rfile (char *filename, bool missing_ok) |
| static void | write_reconstructed_file (char *input_filename, char *output_filename, unsigned block_length, rfile **sourcemap, off_t *offsetmap, pg_checksum_context *checksum_ctx, CopyMethod copy_method, bool debug, bool dry_run) |
| static void | read_bytes (rfile *rf, void *buffer, unsigned length) |
| static void | write_block (int fd, char *output_filename, uint8 *buffer, pg_checksum_context *checksum_ctx) |
| static void | read_block (rfile *s, off_t off, uint8 *buffer) |
| void | reconstruct_from_incremental_file (char *input_filename, char *output_filename, char *relative_path, char *bare_file_name, int n_prior_backups, char **prior_backup_dirs, manifest_data **manifests, char *manifest_path, pg_checksum_type checksum_type, int *checksum_length, uint8 **checksum_payload, CopyMethod copy_method, bool debug, bool dry_run) |
|
static |
Definition at line 384 of file reconstruct.c.
References dry_run, rfile::fd, rfile::filename, fstat, rfile::highest_offset_read, i, rfile::num_blocks_read, pg_fatal, pg_log_debug, and stat::st_size.
Referenced by reconstruct_from_incremental_file().
|
static |
Definition at line 439 of file reconstruct.c.
References i, rfile::num_blocks, rfile::relative_block_numbers, and rfile::truncation_block_length.
Referenced by reconstruct_from_incremental_file().
|
static |
Definition at line 456 of file reconstruct.c.
References filename, rfile::header_length, INCREMENTAL_MAGIC, make_rfile(), rfile::num_blocks, pg_fatal, pg_malloc0(), read_bytes(), rfile::relative_block_numbers, and rfile::truncation_block_length.
Referenced by reconstruct_from_incremental_file().
|
static |
Definition at line 511 of file reconstruct.c.
References rfile::fd, rfile::filename, filename, PG_BINARY, pg_fatal, pg_free(), pg_malloc0(), and pstrdup().
Referenced by make_incremental_rfile(), and reconstruct_from_incremental_file().
Definition at line 777 of file reconstruct.c.
References rfile::fd, rfile::filename, pg_fatal, and pg_pread.
Referenced by write_reconstructed_file().
|
static |
Definition at line 535 of file reconstruct.c.
References rfile::fd, rfile::filename, pg_fatal, and read.
Referenced by make_incremental_rfile().
| void reconstruct_from_incremental_file | ( | char * | input_filename, |
| char * | output_filename, | ||
| char * | relative_path, | ||
| char * | bare_file_name, | ||
| int | n_prior_backups, | ||
| char ** | prior_backup_dirs, | ||
| manifest_data ** | manifests, | ||
| char * | manifest_path, | ||
| pg_checksum_type | checksum_type, | ||
| int * | checksum_length, | ||
| uint8 ** | checksum_payload, | ||
| CopyMethod | copy_method, | ||
| bool | debug, | ||
| bool | dry_run | ||
| ) |
Definition at line 88 of file reconstruct.c.
References Assert(), b, manifest_file::checksum_length, manifest_file::checksum_payload, manifest_file::checksum_type, CHECKSUM_TYPE_NONE, close, copy_file(), debug, debug_reconstruction(), dry_run, rfile::fd, rfile::filename, filename, find_reconstructed_block_length(), fstat, rfile::header_length, i, if(), input_filename, make_incremental_rfile(), make_rfile(), MAXPGPATH, rfile::num_blocks, output_filename, pfree(), pg_checksum_final(), pg_checksum_init(), PG_CHECKSUM_MAX_LENGTH, pg_fatal, pg_free(), pg_log_warning, pg_malloc(), pg_malloc0(), psprintf(), rfile::relative_block_numbers, snprintf, source, stat::st_size, rfile::truncation_block_length, and write_reconstructed_file().
Referenced by process_directory_recursively().
|
static |
Definition at line 753 of file reconstruct.c.
References fd(), output_filename, pg_checksum_update(), pg_fatal, and write.
Referenced by write_reconstructed_file().
|
static |
Definition at line 553 of file reconstruct.c.
References appendStringInfo(), CHECKSUM_TYPE_NONE, close, COPY_METHOD_COPY_FILE_RANGE, StringInfoData::data, debug, dry_run, rfile::fd, rfile::filename, rfile::highest_offset_read, i, initStringInfo(), input_filename, StringInfoData::len, Max, rfile::num_blocks_read, output_filename, pfree(), PG_BINARY, pg_checksum_type_name(), pg_checksum_update(), pg_fatal, pg_file_create_mode, pg_log_debug, read_block(), resetStringInfo(), pg_checksum_context::type, UINT64_FORMAT, and write_block().
Referenced by reconstruct_from_incremental_file().