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

Commit7f1fb47

Browse files
author
Arthur Zakirov
committed
Issue#63: Do not copy unnecessary files
1 parentf84b21c commit7f1fb47

File tree

7 files changed

+211
-269
lines changed

7 files changed

+211
-269
lines changed

‎src/backup.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ ReceiveFileList(parray* files, PGconn *conn, PGresult *res, int rownum)
259259
/* First part of header is zero terminated filename */
260260
snprintf(filename,sizeof(filename),"%s",copybuf);
261261

262-
pgfile=pgFileInit(filename);
262+
pgfile=pgFileInit(filename,filename);
263263
pgfile->size=current_len_left;
264264
pgfile->mode |=filemode;
265265

@@ -2381,7 +2381,8 @@ pg_stop_backup(pgBackup *backup)
23812381
*/
23822382
if (backup_files_list)
23832383
{
2384-
file=pgFileNew(backup_label, true,0,FIO_BACKUP_HOST);
2384+
file=pgFileNew(backup_label,backup_label, true,0,
2385+
FIO_BACKUP_HOST);
23852386
calc_file_checksum(file,FIO_BACKUP_HOST);
23862387
free(file->path);
23872388
file->path=strdup(PG_BACKUP_LABEL_FILE);
@@ -2424,7 +2425,8 @@ pg_stop_backup(pgBackup *backup)
24242425

24252426
if (backup_files_list)
24262427
{
2427-
file=pgFileNew(tablespace_map, true,0,FIO_BACKUP_HOST);
2428+
file=pgFileNew(tablespace_map,tablespace_map, true,0,
2429+
FIO_BACKUP_HOST);
24282430
if (S_ISREG(file->mode))
24292431
calc_file_checksum(file,FIO_BACKUP_HOST);
24302432
free(file->path);
@@ -2826,7 +2828,6 @@ backup_files(void *arg)
28262828
file);
28272829
else
28282830
{
2829-
constchar*src;
28302831
constchar*dst;
28312832
boolskip= false;
28322833
charexternal_dst[MAXPGPATH];
@@ -2846,16 +2847,12 @@ backup_files(void *arg)
28462847
makeExternalDirPathByNum(external_dst,
28472848
arguments->external_prefix,
28482849
file->external_dir_num);
2849-
src=external_path;
28502850
dst=external_dst;
28512851
}
28522852
else
2853-
{
2854-
src=arguments->from_root;
28552853
dst=arguments->to_root;
2856-
}
28572854
if (skip||
2858-
!copy_file(src,FIO_DB_HOST,dst,FIO_BACKUP_HOST,file))
2855+
!copy_file(FIO_DB_HOST,dst,FIO_BACKUP_HOST,file))
28592856
{
28602857
/* disappeared file not to be confused with 'not changed' */
28612858
if (file->write_size!=FILE_NOT_FOUND)

‎src/data.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,8 @@ restore_data_file(const char *to_path, pgFile *file, bool allow_truncate,
941941
* it is either small control file or already compressed cfs file.
942942
*/
943943
bool
944-
copy_file(constchar*from_root,fio_locationfrom_location,
945-
constchar*to_root,fio_locationto_location,pgFile*file)
944+
copy_file(fio_locationfrom_location,constchar*to_root,
945+
fio_locationto_location,pgFile*file)
946946
{
947947
charto_path[MAXPGPATH];
948948
FILE*in;
@@ -979,7 +979,7 @@ copy_file(const char *from_root, fio_location from_location,
979979
}
980980

981981
/* open backup file for write */
982-
join_path_components(to_path,to_root,file->path+strlen(from_root)+1);
982+
join_path_components(to_path,to_root,file->rel_path);
983983
out=fio_fopen(to_path,PG_BINARY_W,to_location);
984984
if (out==NULL)
985985
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp