@@ -983,14 +983,18 @@ restore_chain(pgBackup *dest_backup, parray *parent_chain,
983
983
search_key .rel_path = XLOG_CONTROL_FILE ;
984
984
search_key .external_dir_num = 0 ;
985
985
control_file_elem_index = parray_bsearch_index (dest_files ,& search_key ,pgFileCompareRelPathWithExternal );
986
- if (control_file_elem_index < 0 )
987
- elog (ERROR ,"\"%s\" not found in backup %s" ,XLOG_CONTROL_FILE ,base36enc (dest_backup -> start_time ));
986
+
987
+ if (control_file_elem_index < 0 )
988
+ elog (ERROR ,"File \"%s\" not found in backup %s" ,XLOG_CONTROL_FILE ,base36enc (dest_backup -> start_time ));
988
989
dest_pg_control_file = parray_remove (dest_files ,control_file_elem_index );
989
990
990
991
join_path_components (dest_pg_control_fullpath ,pgdata_path ,dest_pg_control_file -> rel_path );
991
992
/* remove dest control file before restoring */
992
993
if (params -> incremental_mode != INCR_NONE )
993
994
fio_unlink (dest_pg_control_fullpath ,FIO_DB_HOST );
995
+
996
+ // TODO: maybe we should rename "pg_control" into something like "pg_control.pbk" to
997
+ // keep the ability to rerun failed incremental restore ?
994
998
}
995
999
996
1000
elog (INFO ,"Start restoring backup files. PGDATA size: %s" ,pretty_dest_bytes );
@@ -1036,7 +1040,6 @@ restore_chain(pgBackup *dest_backup, parray *parent_chain,
1036
1040
/* [Issue #313] copy pg_control at very end */
1037
1041
if (restore_isok )
1038
1042
{
1039
- fio_is_remote (FIO_DB_HOST );/* reopen already closed ssh connection */
1040
1043
total_bytes += restore_file (dest_pg_control_file ,dest_pg_control_fullpath , false,NULL ,
1041
1044
dest_backup ,parent_chain ,use_bitmap ,params -> incremental_mode ,params -> shift_lsn );
1042
1045
fio_disconnect ();
@@ -1103,7 +1106,6 @@ restore_chain(pgBackup *dest_backup, parray *parent_chain,
1103
1106
}
1104
1107
1105
1108
/* TODO: write test for case: file to be synced is missing */
1106
- /* MKulagin question: where is fio connection reopened? */
1107
1109
if (fio_sync (to_fullpath ,FIO_DB_HOST )!= 0 )
1108
1110
elog (ERROR ,"Failed to sync file \"%s\": %s" ,to_fullpath ,strerror (errno ));
1109
1111
}