mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-09 14:33:17 +02:00
Fix remote backup validate
This commit is contained in:
parent
1b58ec8c5c
commit
f3c62d6714
@ -999,7 +999,10 @@ do_backup(time_t start_time)
|
||||
// current.data_bytes);
|
||||
|
||||
if (is_remote_agent)
|
||||
{
|
||||
fio_transfer(FIO_BACKUP_START_TIME);
|
||||
fio_transfer(FIO_BACKUP_STOP_LSN);
|
||||
}
|
||||
else
|
||||
complete_backup();
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
*
|
||||
*/
|
||||
char *
|
||||
slurpFile(const char *datadir, const char *path, size_t *filesize, bool safe)
|
||||
slurpFile(const char *datadir, const char *path, size_t *filesize, bool safe, fio_location location)
|
||||
{
|
||||
int fd;
|
||||
char *buffer;
|
||||
@ -34,7 +34,7 @@ slurpFile(const char *datadir, const char *path, size_t *filesize, bool safe)
|
||||
int len;
|
||||
snprintf(fullpath, sizeof(fullpath), "%s/%s", datadir, path);
|
||||
|
||||
if ((fd = fio_open(fullpath, O_RDONLY | PG_BINARY, FIO_DB_HOST)) == -1)
|
||||
if ((fd = fio_open(fullpath, O_RDONLY | PG_BINARY, location)) == -1)
|
||||
{
|
||||
if (safe)
|
||||
return NULL;
|
||||
|
@ -454,7 +454,8 @@ extern int do_delete_instance(void);
|
||||
extern char *slurpFile(const char *datadir,
|
||||
const char *path,
|
||||
size_t *filesize,
|
||||
bool safe);
|
||||
bool safe,
|
||||
fio_location location);
|
||||
extern char *fetchFile(PGconn *conn, const char *filename, size_t *filesize);
|
||||
|
||||
/* in help.c */
|
||||
|
14
src/util.c
14
src/util.c
@ -154,7 +154,7 @@ get_current_timeline(bool safe)
|
||||
|
||||
/* First fetch file... */
|
||||
buffer = slurpFile(instance_config.pgdata, "global/pg_control", &size,
|
||||
safe);
|
||||
safe, FIO_DB_HOST);
|
||||
if (safe && buffer == NULL)
|
||||
return 0;
|
||||
|
||||
@ -212,7 +212,7 @@ get_system_identifier(const char *pgdata_path)
|
||||
size_t size;
|
||||
|
||||
/* First fetch file... */
|
||||
buffer = slurpFile(pgdata_path, "global/pg_control", &size, false);
|
||||
buffer = slurpFile(pgdata_path, "global/pg_control", &size, false, FIO_DB_HOST);
|
||||
if (buffer == NULL)
|
||||
return 0;
|
||||
digestControlFile(&ControlFile, buffer, size);
|
||||
@ -263,7 +263,7 @@ get_xlog_seg_size(char *pgdata_path)
|
||||
size_t size;
|
||||
|
||||
/* First fetch file... */
|
||||
buffer = slurpFile(pgdata_path, "global/pg_control", &size, false);
|
||||
buffer = slurpFile(pgdata_path, "global/pg_control", &size, false, FIO_DB_HOST);
|
||||
if (buffer == NULL)
|
||||
return 0;
|
||||
digestControlFile(&ControlFile, buffer, size);
|
||||
@ -284,7 +284,7 @@ get_data_checksum_version(bool safe)
|
||||
|
||||
/* First fetch file... */
|
||||
buffer = slurpFile(instance_config.pgdata, "global/pg_control", &size,
|
||||
safe);
|
||||
safe, FIO_DB_HOST);
|
||||
if (buffer == NULL)
|
||||
return 0;
|
||||
digestControlFile(&ControlFile, buffer, size);
|
||||
@ -301,7 +301,7 @@ get_pgcontrol_checksum(const char *pgdata_path)
|
||||
size_t size;
|
||||
|
||||
/* First fetch file... */
|
||||
buffer = slurpFile(pgdata_path, "global/pg_control", &size, false);
|
||||
buffer = slurpFile(pgdata_path, "global/pg_control", &size, false, FIO_BACKUP_HOST);
|
||||
if (buffer == NULL)
|
||||
return 0;
|
||||
digestControlFile(&ControlFile, buffer, size);
|
||||
@ -324,7 +324,7 @@ set_min_recovery_point(pgFile *file, const char *backup_path,
|
||||
char fullpath[MAXPGPATH];
|
||||
|
||||
/* First fetch file content */
|
||||
buffer = slurpFile(instance_config.pgdata, XLOG_CONTROL_FILE, &size, false);
|
||||
buffer = slurpFile(instance_config.pgdata, XLOG_CONTROL_FILE, &size, false, FIO_DB_HOST);
|
||||
if (buffer == NULL)
|
||||
elog(ERROR, "ERROR");
|
||||
|
||||
@ -367,7 +367,7 @@ copy_pgcontrol_file(const char *from_root, const char *to_root, pgFile *file, fi
|
||||
size_t size;
|
||||
char to_path[MAXPGPATH];
|
||||
|
||||
buffer = slurpFile(from_root, XLOG_CONTROL_FILE, &size, false);
|
||||
buffer = slurpFile(from_root, XLOG_CONTROL_FILE, &size, false, FIO_DB_HOST);
|
||||
|
||||
digestControlFile(&ControlFile, buffer, size);
|
||||
|
||||
|
@ -18,7 +18,8 @@ static int fio_stdin = 0;
|
||||
|
||||
static fio_binding fio_bindings[] =
|
||||
{
|
||||
{¤t.start_time, sizeof(current.start_time)}
|
||||
{¤t.start_time, sizeof(current.start_time)},
|
||||
{¤t.stop_lsn, sizeof(current.stop_lsn)}
|
||||
};
|
||||
|
||||
#define fio_fileno(f) (((size_t)f - 1) | FIO_PIPE_MARKER)
|
||||
|
@ -38,7 +38,8 @@ typedef enum
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FIO_BACKUP_START_TIME
|
||||
FIO_BACKUP_START_TIME,
|
||||
FIO_BACKUP_STOP_LSN
|
||||
} fio_shared_variable;
|
||||
|
||||
#define FIO_FDMAX 64
|
||||
|
Loading…
x
Reference in New Issue
Block a user