From 61cbf0c4596cd8cafb820862a2f2af38a83c05b2 Mon Sep 17 00:00:00 2001 From: Arthur Zakirov Date: Wed, 26 Sep 2018 14:00:00 +0300 Subject: [PATCH] Bug fix. Do not sort links list within read_tablespace_map it sould do callers --- src/dir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dir.c b/src/dir.c index c1f12196..08424ebb 100644 --- a/src/dir.c +++ b/src/dir.c @@ -918,6 +918,8 @@ create_data_directories(const char *data_dir, const char *backup_dir, { links = parray_new(); read_tablespace_map(links, backup_dir); + /* Sort links by a link name*/ + parray_qsort(links, pgFileComparePath); } join_path_components(backup_database_dir, backup_dir, DATABASE_DIR); @@ -1102,7 +1104,6 @@ read_tablespace_map(parray *files, const char *backup_dir) parray_append(files, file); } - parray_qsort(files, pgFileCompareLinked); fclose(fp); } @@ -1126,6 +1127,8 @@ check_tablespace_mapping(pgBackup *backup) pgBackupGetPath(backup, this_backup_path, lengthof(this_backup_path), NULL); read_tablespace_map(links, this_backup_path); + /* Sort links by the path of a linked file*/ + parray_qsort(links, pgFileCompareLinked); if (log_level_console <= LOG || log_level_file <= LOG) elog(LOG, "check tablespace directories of backup %s",