mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-09 14:33:17 +02:00
Free base36enc's results
This commit is contained in:
parent
e861c7f7f2
commit
1cd6a9762d
4
delete.c
4
delete.c
@ -263,9 +263,11 @@ pgBackupDeleteFiles(pgBackup *backup)
|
||||
if (backup->status == BACKUP_STATUS_DELETED)
|
||||
return 0;
|
||||
|
||||
backup_id = base36enc(backup->start_time);
|
||||
time2iso(timestamp, lengthof(timestamp), backup->recovery_time);
|
||||
|
||||
elog(INFO, "delete: %s %s", base36enc(backup->start_time), timestamp);
|
||||
elog(INFO, "delete: %s %s", backup_id, timestamp);
|
||||
free(backup_id);
|
||||
|
||||
/*
|
||||
* Update STATUS to BACKUP_STATUS_DELETING in preparation for the case which
|
||||
|
@ -159,7 +159,7 @@ do_restore_or_validate(time_t target_backup_id,
|
||||
{
|
||||
if (target_backup_id != INVALID_BACKUP_ID)
|
||||
elog(ERROR, "target backup %s does not satisfy restore options",
|
||||
base36enc(target_backup_id));
|
||||
base36enc(target_backup_id));
|
||||
else
|
||||
/* Try to find another backup that satisfies target options */
|
||||
continue;
|
||||
|
7
show.c
7
show.c
@ -33,6 +33,7 @@ do_show(time_t requested_backup_id)
|
||||
if (backup == NULL)
|
||||
{
|
||||
elog(INFO, "Requested backup \"%s\" is not found.",
|
||||
/* We do not need free base36enc's result, we exit anyway */
|
||||
base36enc(requested_backup_id));
|
||||
/* This is not error */
|
||||
return 0;
|
||||
@ -174,6 +175,7 @@ show_backup_list(FILE *out, parray *backup_list)
|
||||
{
|
||||
pgBackup *backup = parray_get(backup_list, i);
|
||||
TimeLineID parent_tli;
|
||||
char *backup_id;
|
||||
char timestamp[20] = "----";
|
||||
char duration[20] = "----";
|
||||
char data_bytes_str[10] = "----";
|
||||
@ -194,9 +196,10 @@ show_backup_list(FILE *out, parray *backup_list)
|
||||
|
||||
/* Get parent timeline before printing */
|
||||
parent_tli = get_parent_tli(backup->tli);
|
||||
backup_id = base36enc(backup->start_time);
|
||||
|
||||
fprintf(out, "%-8s %-19s %s%-9s %2d / %d %5s %6s %2X/%08X %2X/%08X %-8s\n",
|
||||
base36enc(backup->start_time),
|
||||
backup_id,
|
||||
timestamp,
|
||||
backupModes[backup->backup_mode],
|
||||
backup->stream ? "+STREAM": "+ARCHIVE",
|
||||
@ -209,6 +212,8 @@ show_backup_list(FILE *out, parray *backup_list)
|
||||
(uint32) (backup->stop_lsn >> 32),
|
||||
(uint32) backup->stop_lsn,
|
||||
status2str(backup->status));
|
||||
|
||||
free(backup_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
15
validate.c
15
validate.c
@ -29,14 +29,14 @@ typedef struct
|
||||
void
|
||||
pgBackupValidate(pgBackup *backup)
|
||||
{
|
||||
char *backup_id_string;
|
||||
char base_path[MAXPGPATH];
|
||||
char path[MAXPGPATH];
|
||||
parray *files;
|
||||
bool corrupted = false;
|
||||
char *backup_id_string;
|
||||
char base_path[MAXPGPATH];
|
||||
char path[MAXPGPATH];
|
||||
parray *files;
|
||||
bool corrupted = false;
|
||||
pthread_t validate_threads[num_threads];
|
||||
validate_files_args *validate_threads_args[num_threads];
|
||||
int i;
|
||||
int i;
|
||||
|
||||
backup_id_string = base36enc(backup->start_time);
|
||||
|
||||
@ -54,7 +54,7 @@ pgBackupValidate(pgBackup *backup)
|
||||
/* setup threads */
|
||||
for (i = 0; i < parray_num(files); i++)
|
||||
{
|
||||
pgFile *file = (pgFile *) parray_get(files, i);
|
||||
pgFile *file = (pgFile *) parray_get(files, i);
|
||||
__sync_lock_release(&file->lock);
|
||||
}
|
||||
|
||||
@ -95,6 +95,7 @@ pgBackupValidate(pgBackup *backup)
|
||||
elog(WARNING, "Backup %s is corrupted", backup_id_string);
|
||||
else
|
||||
elog(LOG, "Backup %s is valid", backup_id_string);
|
||||
free(backup_id_string);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user