@@ -91,31 +91,6 @@ write_backup_status(pgBackup *backup, BackupStatus status)
91
91
pgBackupFree (tmp );
92
92
}
93
93
94
- /* update some fields of backup control file */
95
- void
96
- write_backup_control_on_the_fly (pgBackup * backup )
97
- {
98
- pgBackup * tmp ;
99
-
100
- tmp = read_backup (backup -> start_time );
101
- if (!tmp )
102
- {
103
- /*
104
- * Silently exit the function, since read_backup already logged the
105
- * warning message.
106
- */
107
- return ;
108
- }
109
-
110
- tmp -> status = backup -> status ;
111
- tmp -> data_bytes = backup -> data_bytes ;
112
- backup -> duration = difftime (time (NULL ), backup -> start_time );
113
- tmp -> duration = backup -> duration ;
114
- write_backup (tmp );
115
-
116
- pgBackupFree (tmp );
117
- }
118
-
119
94
/*
120
95
* Create exclusive lockfile in the backup's directory.
121
96
*/
@@ -610,8 +585,6 @@ pgBackupWriteControl(FILE *out, pgBackup *backup)
610
585
/* print external directories list */
611
586
if (backup -> external_dir_str )
612
587
fio_fprintf (out , "external-dirs = '%s'\n" , backup -> external_dir_str );
613
-
614
- fio_fprintf (out , "duration = " INT64_FORMAT "\n" , backup -> duration );
615
588
}
616
589
617
590
/*
@@ -687,11 +660,10 @@ write_backup_filelist(pgBackup *backup, parray *files, const char *root,
687
660
688
661
i ++ ;
689
662
663
+ /* if file is not backuped yet, do not add it to the list */
664
+ /* TODO check that we correctly handle files which disappeared during backups */
690
665
if (!file -> backuped )
691
- {
692
- elog (WARNING , "file not backuped %s" , file -> rel_path );
693
666
continue ;
694
- }
695
667
696
668
if (S_ISDIR (file -> mode ))
697
669
backup_size_on_disk += 4096 ;
@@ -778,7 +750,7 @@ write_backup_filelist(pgBackup *backup, parray *files, const char *root,
778
750
779
751
/* use extra variable to avoid reset of previous data_bytes value in case of error */
780
752
backup -> data_bytes = backup_size_on_disk ;
781
- write_backup_control_on_the_fly (backup );
753
+ write_backup (backup );
782
754
}
783
755
784
756
/*
@@ -826,7 +798,6 @@ readBackupControlFile(const char *path)
826
798
{'b' , 0 , "from-replica" , & backup -> from_replica , SOURCE_FILE_STRICT },
827
799
{'s' , 0 , "primary-conninfo" , & backup -> primary_conninfo , SOURCE_FILE_STRICT },
828
800
{'s' , 0 , "external-dirs" , & backup -> external_dir_str , SOURCE_FILE_STRICT },
829
- {'I' , 0 , "duration" , & backup -> duration , SOURCE_FILE_STRICT },
830
801
{0 }
831
802
};
832
803
@@ -1058,8 +1029,6 @@ pgBackupInit(pgBackup *backup)
1058
1029
backup -> program_version [0 ] = '\0' ;
1059
1030
backup -> server_version [0 ] = '\0' ;
1060
1031
backup -> external_dir_str = NULL ;
1061
-
1062
- backup -> duration = (time_t ) 0 ;
1063
1032
}
1064
1033
1065
1034
/* free pgBackup object */
0 commit comments