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

Commit0ef2339

Browse files
committed
[Issue#313] review feedback
1 parenta6f3b12 commit0ef2339

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/restore.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,14 +983,18 @@ restore_chain(pgBackup *dest_backup, parray *parent_chain,
983983
search_key.rel_path=XLOG_CONTROL_FILE;
984984
search_key.external_dir_num=0;
985985
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));
988989
dest_pg_control_file=parray_remove(dest_files,control_file_elem_index);
989990

990991
join_path_components(dest_pg_control_fullpath,pgdata_path,dest_pg_control_file->rel_path);
991992
/* remove dest control file before restoring */
992993
if (params->incremental_mode!=INCR_NONE)
993994
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 ?
994998
}
995999

9961000
elog(INFO,"Start restoring backup files. PGDATA size: %s",pretty_dest_bytes);
@@ -1036,7 +1040,6 @@ restore_chain(pgBackup *dest_backup, parray *parent_chain,
10361040
/* [Issue #313] copy pg_control at very end */
10371041
if (restore_isok)
10381042
{
1039-
fio_is_remote(FIO_DB_HOST);/* reopen already closed ssh connection */
10401043
total_bytes+=restore_file(dest_pg_control_file,dest_pg_control_fullpath, false,NULL,
10411044
dest_backup,parent_chain,use_bitmap,params->incremental_mode,params->shift_lsn);
10421045
fio_disconnect();
@@ -1103,7 +1106,6 @@ restore_chain(pgBackup *dest_backup, parray *parent_chain,
11031106
}
11041107

11051108
/* TODO: write test for case: file to be synced is missing */
1106-
/* MKulagin question: where is fio connection reopened? */
11071109
if (fio_sync(to_fullpath,FIO_DB_HOST)!=0)
11081110
elog(ERROR,"Failed to sync file \"%s\": %s",to_fullpath,strerror(errno));
11091111
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp