@@ -427,13 +427,13 @@ merge_chain(parray *parent_chain, pgBackup *full_backup, pgBackup *dest_backup)
427
427
/* for fancy reporting */
428
428
time_t end_time ;
429
429
char pretty_time [20 ];
430
- /* in-place flags */
430
+ /* in-place merge flags */
431
431
bool compression_match = false;
432
432
bool program_version_match = false;
433
433
/* It's redundant to check block checksumms during merge */
434
434
skip_block_validation = true;
435
435
436
- /* Handle corner cases missing destination backup */
436
+ /* Handle corner cases of missing destination backup */
437
437
if (dest_backup == NULL &&
438
438
full_backup -> status == BACKUP_STATUS_MERGED )
439
439
goto merge_rename ;
@@ -740,12 +740,11 @@ merge_chain(parray *parent_chain, pgBackup *full_backup, pgBackup *dest_backup)
740
740
}
741
741
742
742
/*
743
- * If we crash now, automatic rerun of failed merge will be impossible.
744
- * The user must have to manually change start_time of FULL backup
745
- * to start_time of destination backup:
746
743
* PAGE2 DELETED
747
744
* PAGE1 DELETED
748
745
* FULL MERGED
746
+ * If we crash now, automatic rerun of failed merge is still possible:
747
+ * The user should start merge with full backup ID as an argument to option '-i'.
749
748
*/
750
749
751
750
merge_rename :
@@ -891,7 +890,7 @@ merge_files(void *arg)
891
890
*
892
891
* Case 2:
893
892
* in this case in place merge is possible:
894
- * 0 PAGE; file, size BYTES_INVALID (should not be possible)
893
+ * 0 PAGE; file, size 0
895
894
* 1 PAGE; file, size 0
896
895
* 2 FULL; file, size 100500
897
896
*
@@ -901,11 +900,11 @@ merge_files(void *arg)
901
900
* 1 PAGE; file, size 100501
902
901
* 2 FULL; file, size 100500
903
902
*
904
- * Case 4:
903
+ * Case 4 (good candidate for future optimization) :
905
904
* in this case in place merge is impossible:
906
905
* 0 PAGE; file, size BYTES_INVALID
907
906
* 1 PAGE; file, size 100501
908
- * 2 FULL; file, missing
907
+ * 2 FULL; file, not exists yet
909
908
*/
910
909
911
910
in_place = true;
@@ -1138,6 +1137,7 @@ merge_data_file(parray *parent_chain, pgBackup *full_backup,
1138
1137
if (tmp_file -> write_size == 0 )
1139
1138
return ;
1140
1139
1140
+ /* sync second temp file to disk */
1141
1141
if (fio_sync (to_fullpath_tmp2 , FIO_BACKUP_HOST ) != 0 )
1142
1142
elog (ERROR , "Cannot sync merge temp file \"%s\": %s" ,
1143
1143
to_fullpath_tmp2 , strerror (errno ));
@@ -1242,7 +1242,7 @@ merge_non_data_file(parray *parent_chain, pgBackup *full_backup,
1242
1242
backup_non_data_file (tmp_file , NULL , from_fullpath ,
1243
1243
to_fullpath_tmp , BACKUP_MODE_FULL , 0 , false);
1244
1244
1245
- /* TODO: --no- sync support */
1245
+ /* sync temp file to disk */
1246
1246
if (fio_sync (to_fullpath_tmp , FIO_BACKUP_HOST ) != 0 )
1247
1247
elog (ERROR , "Cannot sync merge temp file \"%s\": %s" ,
1248
1248
to_fullpath_tmp , strerror (errno ));
0 commit comments