Skip to content

Commit 61cbf0c

Browse files
committed
Bug fix. Do not sort links list within read_tablespace_map it sould do callers
1 parent bf3bb35 commit 61cbf0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/dir.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,8 @@ create_data_directories(const char *data_dir, const char *backup_dir,
918918
{
919919
links = parray_new();
920920
read_tablespace_map(links, backup_dir);
921+
/* Sort links by a link name*/
922+
parray_qsort(links, pgFileComparePath);
921923
}
922924

923925
join_path_components(backup_database_dir, backup_dir, DATABASE_DIR);
@@ -1102,7 +1104,6 @@ read_tablespace_map(parray *files, const char *backup_dir)
11021104
parray_append(files, file);
11031105
}
11041106

1105-
parray_qsort(files, pgFileCompareLinked);
11061107
fclose(fp);
11071108
}
11081109

@@ -1126,6 +1127,8 @@ check_tablespace_mapping(pgBackup *backup)
11261127

11271128
pgBackupGetPath(backup, this_backup_path, lengthof(this_backup_path), NULL);
11281129
read_tablespace_map(links, this_backup_path);
1130+
/* Sort links by the path of a linked file*/
1131+
parray_qsort(links, pgFileCompareLinked);
11291132

11301133
if (log_level_console <= LOG || log_level_file <= LOG)
11311134
elog(LOG, "check tablespace directories of backup %s",

0 commit comments

Comments
 (0)