Skip to content

Commit a1e005e

Browse files
committed
[Issue #169] Minor improvements to restore
1 parent 385c16b commit a1e005e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/restore.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,6 @@ restore_chain(pgBackup *dest_backup, parray *parent_chain,
721721
if (S_ISDIR(dest_file->mode))
722722
continue;
723723

724-
if (params->skip_external_dirs && dest_file->external_dir_num > 0)
725-
continue;
726-
727724
/* construct fullpath */
728725
if (dest_file->external_dir_num == 0)
729726
{
@@ -813,7 +810,7 @@ restore_files_new(void *arg)
813810
create_empty_file(FIO_BACKUP_HOST,
814811
arguments->to_root, FIO_DB_HOST, dest_file);
815812

816-
elog(INFO, "Skip file due to partial restore: \"%s\"",
813+
elog(VERBOSE, "Skip file due to partial restore: \"%s\"",
817814
dest_file->rel_path);
818815
continue;
819816
}
@@ -887,15 +884,15 @@ restore_files_new(void *arg)
887884
*/
888885

889886
done:
890-
// chmod
891-
// close
892887

893888
/* truncate file up to n_blocks. NOTE: no need, we just should not write
894889
* blocks that are exceeding n_blocks.
895890
* But for this to work, n_blocks should be trusted.
896891
*/
897892

898-
/* update file permission */
893+
/* update file permission
894+
* TODO: chmod must be done right after fopen()
895+
*/
899896
if (fio_chmod(to_fullpath, dest_file->mode, FIO_DB_HOST) == -1)
900897
{
901898
int errno_tmp = errno;
@@ -910,6 +907,9 @@ restore_files_new(void *arg)
910907
strerror(errno));
911908
}
912909

910+
/* ssh connection to longer needed */
911+
fio_disconnect();
912+
913913
/* Data files restoring is successful */
914914
arguments->ret = 0;
915915

0 commit comments

Comments
 (0)