Skip to content

Commit b16555a

Browse files
committed
fix external dir path, introduced by 286d30d
1 parent d624863 commit b16555a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/backup.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
283283

284284
/* initialize backup's file list */
285285
backup_files_list = parray_new();
286-
join_path_components(external_prefix, current.database_dir, EXTERNAL_DIR);
286+
join_path_components(external_prefix, current.root_dir, EXTERNAL_DIR);
287287

288288
/* list files with the logical path. omit $PGDATA */
289289
if (fio_is_remote(FIO_DB_HOST))
@@ -738,6 +738,11 @@ do_backup(pgSetBackupParams *set_backup_params,
738738
/* Initialize PGInfonode */
739739
pgNodeInit(&nodeInfo);
740740

741+
/* Save list of external directories */
742+
if (instance_config.external_dir_str &&
743+
(pg_strcasecmp(instance_config.external_dir_str, "none") != 0))
744+
current.external_dir_str = instance_config.external_dir_str;
745+
741746
/* Create backup directory and BACKUP_CONTROL_FILE */
742747
pgBackupCreateDir(&current, backup_instance_path);
743748

@@ -755,11 +760,6 @@ do_backup(pgSetBackupParams *set_backup_params,
755760
current.compress_alg = instance_config.compress_alg;
756761
current.compress_level = instance_config.compress_level;
757762

758-
/* Save list of external directories */
759-
if (instance_config.external_dir_str &&
760-
(pg_strcasecmp(instance_config.external_dir_str, "none") != 0))
761-
current.external_dir_str = instance_config.external_dir_str;
762-
763763
elog(INFO, "Backup start, pg_probackup version: %s, instance: %s, backup ID: %s, backup mode: %s, "
764764
"wal mode: %s, remote: %s, compress-algorithm: %s, compress-level: %i",
765765
PROGRAM_VERSION, instance_name, base36enc(current.backup_id), pgBackupGetBackupMode(&current),

src/utils/file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,9 @@ int fio_unlink(char const* path, fio_location location)
10261026
}
10271027
}
10281028

1029-
/* Create directory */
1029+
/* Create directory
1030+
* TODO: add strict flag
1031+
*/
10301032
int fio_mkdir(char const* path, int mode, fio_location location)
10311033
{
10321034
if (fio_is_remote(location))

src/validate.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ typedef struct
4848
void
4949
pgBackupValidate(pgBackup *backup, pgRestoreParams *params)
5050
{
51-
char base_path[MAXPGPATH];
5251
char external_prefix[MAXPGPATH];
5352
parray *files = NULL;
5453
bool corrupted = false;
@@ -115,7 +114,6 @@ pgBackupValidate(pgBackup *backup, pgRestoreParams *params)
115114
backup->backup_mode != BACKUP_MODE_DIFF_DELTA)
116115
elog(WARNING, "Invalid backup_mode of backup %s", base36enc(backup->start_time));
117116

118-
join_path_components(base_path, backup->root_dir, DATABASE_DIR);
119117
join_path_components(external_prefix, backup->root_dir, EXTERNAL_DIR);
120118
files = get_backup_filelist(backup, false);
121119

@@ -149,7 +147,7 @@ pgBackupValidate(pgBackup *backup, pgRestoreParams *params)
149147
{
150148
validate_files_arg *arg = &(threads_args[i]);
151149

152-
arg->base_path = base_path;
150+
arg->base_path = backup->database_dir;
153151
arg->files = files;
154152
arg->corrupted = false;
155153
arg->backup_mode = backup->backup_mode;

0 commit comments

Comments
 (0)