mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-19 20:00:16 +02:00
Code cleanup. remove unused check option
This commit is contained in:
parent
0f59db3399
commit
612070c48d
33
backup.c
33
backup.c
@ -467,12 +467,11 @@ do_backup(bool smooth_checkpoint)
|
|||||||
current.stream = stream_wal;
|
current.stream = stream_wal;
|
||||||
|
|
||||||
/* Create backup directory and backup.ini */
|
/* Create backup directory and backup.ini */
|
||||||
if (!check)
|
|
||||||
{
|
if (pgBackupCreateDir(¤t))
|
||||||
if (pgBackupCreateDir(¤t))
|
elog(ERROR, "cannot create backup directory");
|
||||||
elog(ERROR, "cannot create backup directory");
|
pgBackupWriteIni(¤t);
|
||||||
pgBackupWriteIni(¤t);
|
|
||||||
}
|
|
||||||
elog(LOG, "backup destination is initialized");
|
elog(LOG, "backup destination is initialized");
|
||||||
|
|
||||||
/* get list of backups already taken */
|
/* get list of backups already taken */
|
||||||
@ -490,8 +489,7 @@ do_backup(bool smooth_checkpoint)
|
|||||||
/* update backup status to DONE */
|
/* update backup status to DONE */
|
||||||
current.end_time = time(NULL);
|
current.end_time = time(NULL);
|
||||||
current.status = BACKUP_STATUS_DONE;
|
current.status = BACKUP_STATUS_DONE;
|
||||||
if (!check)
|
pgBackupWriteIni(¤t);
|
||||||
pgBackupWriteIni(¤t);
|
|
||||||
|
|
||||||
/* Calculate the total data read */
|
/* Calculate the total data read */
|
||||||
if (verbose)
|
if (verbose)
|
||||||
@ -1423,18 +1421,15 @@ create_file_list(parray *files, const char *root, bool is_append)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
char path[MAXPGPATH];
|
char path[MAXPGPATH];
|
||||||
|
|
||||||
if (!check)
|
/* output path is '$BACKUP_PATH/file_database.txt' */
|
||||||
{
|
pgBackupGetPath(¤t, path, lengthof(path), DATABASE_FILE_LIST);
|
||||||
/* output path is '$BACKUP_PATH/file_database.txt' */
|
|
||||||
pgBackupGetPath(¤t, path, lengthof(path), DATABASE_FILE_LIST);
|
|
||||||
|
|
||||||
fp = fopen(path, is_append ? "at" : "wt");
|
fp = fopen(path, is_append ? "at" : "wt");
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
elog(ERROR, "cannot open file list \"%s\": %s", path,
|
elog(ERROR, "cannot open file list \"%s\": %s", path,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
print_file_list(fp, files, root);
|
print_file_list(fp, files, root);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
27
data.c
27
data.c
@ -223,10 +223,7 @@ backup_data_file(const char *from_root, const char *to_root,
|
|||||||
nblocks = file->size/BLCKSZ;
|
nblocks = file->size/BLCKSZ;
|
||||||
|
|
||||||
/* open backup file for write */
|
/* open backup file for write */
|
||||||
if (check)
|
join_path_components(to_path, to_root, file->path + strlen(from_root) + 1);
|
||||||
snprintf(to_path, lengthof(to_path), "%s/tmp", backup_path);
|
|
||||||
else
|
|
||||||
join_path_components(to_path, to_root, file->path + strlen(from_root) + 1);
|
|
||||||
out = fopen(to_path, "w");
|
out = fopen(to_path, "w");
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
{
|
{
|
||||||
@ -264,7 +261,7 @@ backup_data_file(const char *from_root, const char *to_root,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update file permission */
|
/* update file permission */
|
||||||
if (!check && chmod(to_path, FILE_PERMISSION) == -1)
|
if (chmod(to_path, FILE_PERMISSION) == -1)
|
||||||
{
|
{
|
||||||
int errno_tmp = errno;
|
int errno_tmp = errno;
|
||||||
fclose(in);
|
fclose(in);
|
||||||
@ -293,10 +290,6 @@ backup_data_file(const char *from_root, const char *to_root,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove $BACKUP_PATH/tmp created during check */
|
|
||||||
if (check)
|
|
||||||
remove(to_path);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -589,10 +582,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* open backup file for write */
|
/* open backup file for write */
|
||||||
if (check)
|
join_path_components(to_path, to_root, file->path + strlen(from_root) + 1);
|
||||||
snprintf(to_path, lengthof(to_path), "%s/tmp", backup_path);
|
|
||||||
else
|
|
||||||
join_path_components(to_path, to_root, file->path + strlen(from_root) + 1);
|
|
||||||
out = fopen(to_path, "w");
|
out = fopen(to_path, "w");
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
{
|
{
|
||||||
@ -678,9 +668,6 @@ copy_file(const char *from_root, const char *to_root, pgFile *file)
|
|||||||
fclose(in);
|
fclose(in);
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
|
||||||
if (check)
|
|
||||||
remove(to_path);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -718,10 +705,7 @@ copy_file_partly(const char *from_root, const char *to_root,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* open backup file for write */
|
/* open backup file for write */
|
||||||
if (check)
|
join_path_components(to_path, to_root, file->path + strlen(from_root) + 1);
|
||||||
snprintf(to_path, lengthof(to_path), "%s/tmp", backup_path);
|
|
||||||
else
|
|
||||||
join_path_components(to_path, to_root, file->path + strlen(from_root) + 1);
|
|
||||||
|
|
||||||
out = fopen(to_path, "w");
|
out = fopen(to_path, "w");
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
@ -812,9 +796,6 @@ copy_file_partly(const char *from_root, const char *to_root,
|
|||||||
fclose(in);
|
fclose(in);
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
|
||||||
if (check)
|
|
||||||
remove(to_path);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
23
delete.c
23
delete.c
@ -270,11 +270,8 @@ pgBackupDeleteFiles(pgBackup *backup)
|
|||||||
* Update STATUS to BACKUP_STATUS_DELETING in preparation for the case which
|
* Update STATUS to BACKUP_STATUS_DELETING in preparation for the case which
|
||||||
* the error occurs before deleting all backup files.
|
* the error occurs before deleting all backup files.
|
||||||
*/
|
*/
|
||||||
if (!check)
|
backup->status = BACKUP_STATUS_DELETING;
|
||||||
{
|
pgBackupWriteIni(backup);
|
||||||
backup->status = BACKUP_STATUS_DELETING;
|
|
||||||
pgBackupWriteIni(backup);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* list files to be deleted */
|
/* list files to be deleted */
|
||||||
files = parray_new();
|
files = parray_new();
|
||||||
@ -291,18 +288,14 @@ pgBackupDeleteFiles(pgBackup *backup)
|
|||||||
elog(LOG, "delete file(%zd/%lu) \"%s\"", i + 1,
|
elog(LOG, "delete file(%zd/%lu) \"%s\"", i + 1,
|
||||||
(unsigned long) parray_num(files), file->path);
|
(unsigned long) parray_num(files), file->path);
|
||||||
|
|
||||||
/* skip actual deletion in check mode */
|
if (remove(file->path))
|
||||||
if (!check)
|
|
||||||
{
|
{
|
||||||
if (remove(file->path))
|
elog(WARNING, "can't remove \"%s\": %s", file->path,
|
||||||
{
|
strerror(errno));
|
||||||
elog(WARNING, "can't remove \"%s\": %s", file->path,
|
parray_walk(files, pgFileFree);
|
||||||
strerror(errno));
|
parray_free(files);
|
||||||
parray_walk(files, pgFileFree);
|
|
||||||
parray_free(files);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,9 +25,6 @@ char *backup_path;
|
|||||||
char *pgdata;
|
char *pgdata;
|
||||||
char arclog_path[MAXPGPATH];
|
char arclog_path[MAXPGPATH];
|
||||||
|
|
||||||
/* common configuration */
|
|
||||||
bool check = false;
|
|
||||||
|
|
||||||
/* directory configuration */
|
/* directory configuration */
|
||||||
pgBackup current;
|
pgBackup current;
|
||||||
|
|
||||||
@ -60,7 +57,6 @@ static pgut_option options[] =
|
|||||||
{ 's', 'D', "pgdata", &pgdata, SOURCE_CMDLINE },
|
{ 's', 'D', "pgdata", &pgdata, SOURCE_CMDLINE },
|
||||||
{ 's', 'B', "backup-path", &backup_path, SOURCE_CMDLINE },
|
{ 's', 'B', "backup-path", &backup_path, SOURCE_CMDLINE },
|
||||||
/* common options */
|
/* common options */
|
||||||
/* { 'b', 'c', "check", &check },*/
|
|
||||||
{ 'u', 'j', "threads", &num_threads, SOURCE_CMDLINE },
|
{ 'u', 'j', "threads", &num_threads, SOURCE_CMDLINE },
|
||||||
{ 'b', 8, "stream", &stream_wal, SOURCE_CMDLINE },
|
{ 'b', 8, "stream", &stream_wal, SOURCE_CMDLINE },
|
||||||
{ 'b', 11, "progress", &progress, SOURCE_CMDLINE },
|
{ 'b', 11, "progress", &progress, SOURCE_CMDLINE },
|
||||||
|
@ -225,9 +225,6 @@ extern char *backup_path;
|
|||||||
extern char *pgdata;
|
extern char *pgdata;
|
||||||
extern char arclog_path[MAXPGPATH];
|
extern char arclog_path[MAXPGPATH];
|
||||||
|
|
||||||
/* common configuration */
|
|
||||||
extern bool check;
|
|
||||||
|
|
||||||
/* current settings */
|
/* current settings */
|
||||||
extern pgBackup current;
|
extern pgBackup current;
|
||||||
|
|
||||||
|
96
restore.c
96
restore.c
@ -222,13 +222,9 @@ base_backup_found:
|
|||||||
parray_free(backups);
|
parray_free(backups);
|
||||||
|
|
||||||
/* print restore complete message */
|
/* print restore complete message */
|
||||||
if (!check)
|
elog(LOG, "all restore completed");
|
||||||
{
|
elog(LOG, "========================================");
|
||||||
elog(LOG, "all restore completed");
|
elog(INFO, "restore complete. Recovery starts automatically when the PostgreSQL server is started.");
|
||||||
elog(LOG, "========================================");
|
|
||||||
}
|
|
||||||
if (!check)
|
|
||||||
elog(INFO, "restore complete. Recovery starts automatically when the PostgreSQL server is started.");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -259,11 +255,9 @@ restore_database(pgBackup *backup)
|
|||||||
backup->wal_block_size, XLOG_BLCKSZ);
|
backup->wal_block_size, XLOG_BLCKSZ);
|
||||||
|
|
||||||
time2iso(timestamp, lengthof(timestamp), backup->start_time);
|
time2iso(timestamp, lengthof(timestamp), backup->start_time);
|
||||||
if (!check)
|
|
||||||
{
|
elog(LOG, "----------------------------------------");
|
||||||
elog(LOG, "----------------------------------------");
|
elog(LOG, "restoring database from backup %s", timestamp);
|
||||||
elog(LOG, "restoring database from backup %s", timestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate backup files with its size, because load of CRC calculation is
|
* Validate backup files with its size, because load of CRC calculation is
|
||||||
@ -321,7 +315,6 @@ restore_database(pgBackup *backup)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Delete files which are not in file list. */
|
/* Delete files which are not in file list. */
|
||||||
if (!check)
|
|
||||||
{
|
{
|
||||||
parray *files_now;
|
parray *files_now;
|
||||||
|
|
||||||
@ -358,8 +351,7 @@ restore_database(pgBackup *backup)
|
|||||||
parray_walk(files, pgFileFree);
|
parray_walk(files, pgFileFree);
|
||||||
parray_free(files);
|
parray_free(files);
|
||||||
|
|
||||||
if (!check)
|
elog(LOG, "restore backup completed");
|
||||||
elog(LOG, "restore backup completed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -597,41 +589,35 @@ restore_files(void *arg)
|
|||||||
rel_path = file->path + strlen(from_root) + 1;
|
rel_path = file->path + strlen(from_root) + 1;
|
||||||
|
|
||||||
/* print progress */
|
/* print progress */
|
||||||
if (!check)
|
elog(LOG, "(%d/%lu) %s ", i + 1, (unsigned long) parray_num(arguments->files),
|
||||||
elog(LOG, "(%d/%lu) %s ", i + 1, (unsigned long) parray_num(arguments->files),
|
|
||||||
rel_path);
|
rel_path);
|
||||||
|
|
||||||
/* Directories are created before */
|
/* Directories are created before */
|
||||||
if (S_ISDIR(file->mode))
|
if (S_ISDIR(file->mode))
|
||||||
{
|
{
|
||||||
if (!check)
|
elog(LOG, "directory, skip");
|
||||||
elog(LOG, "directory, skip");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* not backed up */
|
/* not backed up */
|
||||||
if (file->write_size == BYTES_INVALID)
|
if (file->write_size == BYTES_INVALID)
|
||||||
{
|
{
|
||||||
if (!check)
|
elog(LOG, "not backed up, skip");
|
||||||
elog(LOG, "not backed up, skip");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do not restore tablespace_map file */
|
/* Do not restore tablespace_map file */
|
||||||
if (path_is_prefix_of_path("tablespace_map", rel_path))
|
if (path_is_prefix_of_path("tablespace_map", rel_path))
|
||||||
{
|
{
|
||||||
if (!check)
|
elog(LOG, "skip tablespace_map");
|
||||||
elog(LOG, "skip tablespace_map");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* restore file */
|
/* restore file */
|
||||||
if (!check)
|
restore_data_file(from_root, pgdata, file, arguments->backup);
|
||||||
restore_data_file(from_root, pgdata, file, arguments->backup);
|
|
||||||
|
|
||||||
/* print size of restored file */
|
/* print size of restored file */
|
||||||
if (!check)
|
elog(LOG, "restored %lu\n", (unsigned long) file->write_size);
|
||||||
elog(LOG, "restored %lu\n", (unsigned long) file->write_size);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -645,42 +631,36 @@ create_recovery_conf(time_t backup_id,
|
|||||||
char path[MAXPGPATH];
|
char path[MAXPGPATH];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
if (!check)
|
elog(LOG, "----------------------------------------");
|
||||||
|
elog(LOG, "creating recovery.conf");
|
||||||
|
|
||||||
|
snprintf(path, lengthof(path), "%s/recovery.conf", pgdata);
|
||||||
|
fp = fopen(path, "wt");
|
||||||
|
if (fp == NULL)
|
||||||
|
elog(ERROR, "cannot open recovery.conf \"%s\": %s", path,
|
||||||
|
strerror(errno));
|
||||||
|
|
||||||
|
fprintf(fp, "# recovery.conf generated by pg_probackup %s\n",
|
||||||
|
PROGRAM_VERSION);
|
||||||
|
fprintf(fp, "restore_command = 'cp %s/%%f %%p'\n", arclog_path);
|
||||||
|
|
||||||
|
if (target_time)
|
||||||
|
fprintf(fp, "recovery_target_time = '%s'\n", target_time);
|
||||||
|
else if (target_xid)
|
||||||
|
fprintf(fp, "recovery_target_xid = '%s'\n", target_xid);
|
||||||
|
else if (backup_id != 0)
|
||||||
{
|
{
|
||||||
elog(LOG, "----------------------------------------");
|
fprintf(fp, "recovery_target = 'immediate'\n");
|
||||||
elog(LOG, "creating recovery.conf");
|
fprintf(fp, "recovery_target_action = 'promote'\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!check)
|
if (target_inclusive)
|
||||||
{
|
fprintf(fp, "recovery_target_inclusive = '%s'\n", target_inclusive);
|
||||||
snprintf(path, lengthof(path), "%s/recovery.conf", pgdata);
|
|
||||||
fp = fopen(path, "wt");
|
|
||||||
if (fp == NULL)
|
|
||||||
elog(ERROR, "cannot open recovery.conf \"%s\": %s", path,
|
|
||||||
strerror(errno));
|
|
||||||
|
|
||||||
fprintf(fp, "# recovery.conf generated by pg_probackup %s\n",
|
if (target_tli)
|
||||||
PROGRAM_VERSION);
|
fprintf(fp, "recovery_target_timeline = '%u'\n", target_tli);
|
||||||
fprintf(fp, "restore_command = 'cp %s/%%f %%p'\n", arclog_path);
|
|
||||||
|
|
||||||
if (target_time)
|
fclose(fp);
|
||||||
fprintf(fp, "recovery_target_time = '%s'\n", target_time);
|
|
||||||
else if (target_xid)
|
|
||||||
fprintf(fp, "recovery_target_xid = '%s'\n", target_xid);
|
|
||||||
else if (backup_id != 0)
|
|
||||||
{
|
|
||||||
fprintf(fp, "recovery_target = 'immediate'\n");
|
|
||||||
fprintf(fp, "recovery_target_action = 'promote'\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (target_inclusive)
|
|
||||||
fprintf(fp, "recovery_target_inclusive = '%s'\n", target_inclusive);
|
|
||||||
|
|
||||||
if (target_tli)
|
|
||||||
fprintf(fp, "recovery_target_timeline = '%u'\n", target_tli);
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
99
validate.c
99
validate.c
@ -182,64 +182,61 @@ pgBackupValidate(pgBackup *backup,
|
|||||||
backup_id_string, (size_only ? "SIZE" : "CRC"));
|
backup_id_string, (size_only ? "SIZE" : "CRC"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!check)
|
if (backup->backup_mode == BACKUP_MODE_FULL ||
|
||||||
|
backup->backup_mode == BACKUP_MODE_DIFF_PAGE ||
|
||||||
|
backup->backup_mode == BACKUP_MODE_DIFF_PTRACK)
|
||||||
{
|
{
|
||||||
if (backup->backup_mode == BACKUP_MODE_FULL ||
|
int i;
|
||||||
backup->backup_mode == BACKUP_MODE_DIFF_PAGE ||
|
elog(LOG, "database files...");
|
||||||
backup->backup_mode == BACKUP_MODE_DIFF_PTRACK)
|
pgBackupGetPath(backup, base_path, lengthof(base_path), DATABASE_DIR);
|
||||||
|
pgBackupGetPath(backup, path, lengthof(path),
|
||||||
|
DATABASE_FILE_LIST);
|
||||||
|
files = dir_read_file_list(base_path, path);
|
||||||
|
|
||||||
|
/* setup threads */
|
||||||
|
for (i = 0; i < parray_num(files); i++)
|
||||||
{
|
{
|
||||||
int i;
|
pgFile *file = (pgFile *) parray_get(files, i);
|
||||||
elog(LOG, "database files...");
|
__sync_lock_release(&file->lock);
|
||||||
pgBackupGetPath(backup, base_path, lengthof(base_path), DATABASE_DIR);
|
|
||||||
pgBackupGetPath(backup, path, lengthof(path),
|
|
||||||
DATABASE_FILE_LIST);
|
|
||||||
files = dir_read_file_list(base_path, path);
|
|
||||||
|
|
||||||
/* setup threads */
|
|
||||||
for (i = 0; i < parray_num(files); i++)
|
|
||||||
{
|
|
||||||
pgFile *file = (pgFile *) parray_get(files, i);
|
|
||||||
__sync_lock_release(&file->lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* restore files into $PGDATA */
|
|
||||||
for (i = 0; i < num_threads; i++)
|
|
||||||
{
|
|
||||||
validate_files_args *arg = pg_malloc(sizeof(validate_files_args));
|
|
||||||
arg->files = files;
|
|
||||||
arg->root = base_path;
|
|
||||||
arg->size_only = size_only;
|
|
||||||
arg->corrupted = false;
|
|
||||||
|
|
||||||
validate_threads_args[i] = arg;
|
|
||||||
pthread_create(&validate_threads[i], NULL, (void *(*)(void *)) pgBackupValidateFiles, arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Wait theads */
|
|
||||||
for (i = 0; i < num_threads; i++)
|
|
||||||
{
|
|
||||||
pthread_join(validate_threads[i], NULL);
|
|
||||||
if (validate_threads_args[i]->corrupted)
|
|
||||||
corrupted = true;
|
|
||||||
pg_free(validate_threads_args[i]);
|
|
||||||
}
|
|
||||||
parray_walk(files, pgFileFree);
|
|
||||||
parray_free(files);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update status to OK */
|
/* restore files into $PGDATA */
|
||||||
if (corrupted)
|
for (i = 0; i < num_threads; i++)
|
||||||
backup->status = BACKUP_STATUS_CORRUPT;
|
{
|
||||||
else
|
validate_files_args *arg = pg_malloc(sizeof(validate_files_args));
|
||||||
backup->status = BACKUP_STATUS_OK;
|
arg->files = files;
|
||||||
pgBackupWriteIni(backup);
|
arg->root = base_path;
|
||||||
|
arg->size_only = size_only;
|
||||||
|
arg->corrupted = false;
|
||||||
|
|
||||||
if (corrupted)
|
validate_threads_args[i] = arg;
|
||||||
elog(WARNING, "backup %s is corrupted", backup_id_string);
|
pthread_create(&validate_threads[i], NULL, (void *(*)(void *)) pgBackupValidateFiles, arg);
|
||||||
else
|
}
|
||||||
elog(LOG, "backup %s is valid", backup_id_string);
|
|
||||||
|
/* Wait theads */
|
||||||
|
for (i = 0; i < num_threads; i++)
|
||||||
|
{
|
||||||
|
pthread_join(validate_threads[i], NULL);
|
||||||
|
if (validate_threads_args[i]->corrupted)
|
||||||
|
corrupted = true;
|
||||||
|
pg_free(validate_threads_args[i]);
|
||||||
|
}
|
||||||
|
parray_walk(files, pgFileFree);
|
||||||
|
parray_free(files);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* update status to OK */
|
||||||
|
if (corrupted)
|
||||||
|
backup->status = BACKUP_STATUS_CORRUPT;
|
||||||
|
else
|
||||||
|
backup->status = BACKUP_STATUS_OK;
|
||||||
|
pgBackupWriteIni(backup);
|
||||||
|
|
||||||
|
if (corrupted)
|
||||||
|
elog(WARNING, "backup %s is corrupted", backup_id_string);
|
||||||
|
else
|
||||||
|
elog(LOG, "backup %s is valid", backup_id_string);
|
||||||
|
|
||||||
return !corrupted;
|
return !corrupted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user