@@ -429,7 +429,6 @@ do_backup_instance(PGconn *backup_conn)
429429 }
430430 else
431431 join_path_components (dirpath , database_path , dir_name );
432- file -> backuped = true;
433432 fio_mkdir (dirpath , DIR_PERMISSION , FIO_BACKUP_HOST );
434433 }
435434
@@ -443,6 +442,11 @@ do_backup_instance(PGconn *backup_conn)
443442 if (prev_backup_filelist )
444443 parray_qsort (prev_backup_filelist , pgFileComparePathWithExternal );
445444
445+ /* write initial backup_content.control file and update backup.control */
446+ write_backup_filelist (& current , backup_files_list ,
447+ instance_config .pgdata , external_dirs );
448+ write_backup (& current );
449+
446450 /* init thread args with own file lists */
447451 threads = (pthread_t * ) palloc (sizeof (pthread_t ) * num_threads );
448452 threads_args = (backup_files_arg * ) palloc (sizeof (backup_files_arg )* num_threads );
@@ -1797,7 +1801,6 @@ pg_stop_backup(pgBackup *backup, PGconn *pg_startbackup_conn)
17971801 file -> crc = pgFileGetCRC (file -> path , true, false,
17981802 & file -> read_size , FIO_BACKUP_HOST );
17991803 file -> write_size = file -> read_size ;
1800- file -> backuped = true;
18011804 free (file -> path );
18021805 file -> path = strdup (PG_BACKUP_LABEL_FILE );
18031806 parray_append (backup_files_list , file );
@@ -1846,7 +1849,6 @@ pg_stop_backup(pgBackup *backup, PGconn *pg_startbackup_conn)
18461849 file -> crc = pgFileGetCRC (file -> path , true, false,
18471850 & file -> read_size , FIO_BACKUP_HOST );
18481851 file -> write_size = file -> read_size ;
1849- file -> backuped = true;
18501852 }
18511853 free (file -> path );
18521854 file -> path = strdup (PG_TABLESPACE_MAP_FILE );
@@ -1995,7 +1997,7 @@ backup_files(void *arg)
19951997 {
19961998 prev_time = time (NULL );
19971999
1998- write_backup_filelist (& current , arguments -> files_list , instance_config . pgdata ,
2000+ write_backup_filelist (& current , arguments -> files_list , arguments -> from_root ,
19992001 arguments -> external_dirs );
20002002 /* update backup control file to update size info */
20012003 write_backup (& current );
@@ -2134,7 +2136,6 @@ backup_files(void *arg)
21342136 }
21352137 }
21362138
2137- file -> backuped = true;
21382139 elog (VERBOSE , "File \"%s\". Copied " INT64_FORMAT " bytes" ,
21392140 file -> path , file -> write_size );
21402141 }
0 commit comments