Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3b144bb

Browse files
committed
Fix remote delta backup
1 parent065d981 commit3b144bb

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

‎src/backup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ do_backup_instance(void)
540540
pgBackupGetPath(prev_backup,prev_backup_filelist_path,
541541
lengthof(prev_backup_filelist_path),DATABASE_FILE_LIST);
542542
/* Files of previous backup needed by DELTA backup */
543-
prev_backup_filelist=dir_read_file_list(NULL,prev_backup_filelist_path);
543+
prev_backup_filelist=dir_read_file_list(NULL,prev_backup_filelist_path,FIO_BACKUP_HOST);
544544

545545
/* If lsn is not NULL, only pages with higher lsn will be copied. */
546546
prev_backup_start_lsn=prev_backup->start_lsn;

‎src/dir.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,13 +1404,13 @@ get_control_value(const char *str, const char *name,
14041404
* If root is not NULL, path will be absolute path.
14051405
*/
14061406
parray*
1407-
dir_read_file_list(constchar*root,constchar*file_txt)
1407+
dir_read_file_list(constchar*root,constchar*file_txt,fio_locationlocation)
14081408
{
14091409
FILE*fp;
14101410
parray*files;
14111411
charbuf[MAXPGPATH*2];
14121412

1413-
fp=fopen(file_txt,"rt");
1413+
fp=fio_open_stream(file_txt,location);
14141414
if (fp==NULL)
14151415
elog(ERROR,"cannot open \"%s\": %s",file_txt,strerror(errno));
14161416

@@ -1469,7 +1469,7 @@ dir_read_file_list(const char *root, const char *file_txt)
14691469
parray_append(files,file);
14701470
}
14711471

1472-
fclose(fp);
1472+
fio_close_stream(fp);
14731473
returnfiles;
14741474
}
14751475

‎src/merge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ merge_backups(pgBackup *to_backup, pgBackup *from_backup)
208208
*/
209209
pgBackupGetPath(to_backup,control_file,lengthof(control_file),
210210
DATABASE_FILE_LIST);
211-
to_files=dir_read_file_list(NULL,control_file);
211+
to_files=dir_read_file_list(NULL,control_file,FIO_BACKUP_HOST);
212212
/* To delete from leaf, sort in reversed order */
213213
parray_qsort(to_files,pgFileComparePathDesc);
214214
/*
215215
* Get list of files which need to be moved.
216216
*/
217217
pgBackupGetPath(from_backup,control_file,lengthof(control_file),
218218
DATABASE_FILE_LIST);
219-
files=dir_read_file_list(NULL,control_file);
219+
files=dir_read_file_list(NULL,control_file,FIO_BACKUP_HOST);
220220
/* sort by size for load balancing */
221221
parray_qsort(files,pgFileCompareSize);
222222

‎src/pg_probackup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ extern void opt_tablespace_map(ConfigOption *opt, const char *arg);
520520
externvoidcheck_tablespace_mapping(pgBackup*backup);
521521

522522
externvoidprint_file_list(FILE*out,constparray*files,constchar*root);
523-
externparray*dir_read_file_list(constchar*root,constchar*file_txt);
523+
externparray*dir_read_file_list(constchar*root,constchar*file_txt,fio_locationlocation);
524524

525525
externintdir_create_dir(constchar*path,mode_tmode);
526526
externbooldir_is_empty(constchar*path);

‎src/restore.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ restore_backup(pgBackup *backup)
457457
*/
458458
pgBackupGetPath(backup,database_path,lengthof(database_path),DATABASE_DIR);
459459
pgBackupGetPath(backup,list_path,lengthof(list_path),DATABASE_FILE_LIST);
460-
files=dir_read_file_list(database_path,list_path);
460+
files=dir_read_file_list(database_path,list_path,FIO_DB_HOST);
461461

462462
threads= (pthread_t*)palloc(sizeof(pthread_t)*num_threads);
463463
threads_args= (restore_files_arg*)palloc(sizeof(restore_files_arg)*num_threads);
@@ -523,7 +523,7 @@ remove_deleted_files(pgBackup *backup)
523523

524524
pgBackupGetPath(backup,filelist_path,lengthof(filelist_path),DATABASE_FILE_LIST);
525525
/* Read backup's filelist using target database path as base path */
526-
files=dir_read_file_list(instance_config.pgdata,filelist_path);
526+
files=dir_read_file_list(instance_config.pgdata,filelist_path,FIO_DB_HOST);
527527
parray_qsort(files,pgFileComparePathDesc);
528528

529529
/* Get list of files actually existing in target database */

‎src/validate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pgBackupValidate(pgBackup *backup)
9090

9191
pgBackupGetPath(backup,base_path,lengthof(base_path),DATABASE_DIR);
9292
pgBackupGetPath(backup,path,lengthof(path),DATABASE_FILE_LIST);
93-
files=dir_read_file_list(base_path,path);
93+
files=dir_read_file_list(base_path,path,FIO_BACKUP_HOST);
9494

9595
/* setup threads */
9696
for (i=0;i<parray_num(files);i++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp