1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-24 11:46:31 +02:00

[Issue #228]: remove artefacts of previous implementation

This commit is contained in:
Grigory Smolkin 2020-06-19 14:02:00 +03:00
parent e80f1fe432
commit a7eb948a75
2 changed files with 8 additions and 34 deletions

View File

@ -596,8 +596,14 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
}
/* close block header map */
if (current.hdr_map.fp && fclose(current.hdr_map.fp))
elog(ERROR, "Cannot close file \"%s\"", current.hdr_map.path);
if (current.hdr_map.fp)
{
if (fclose(current.hdr_map.fp))
elog(ERROR, "Cannot close file \"%s\"", current.hdr_map.path);
if (fio_sync(current.hdr_map.path, FIO_BACKUP_HOST) != 0)
elog(ERROR, "Cannot sync file \"%s\": %s", current.hdr_map.path, strerror(errno));
}
/* close ssh session in main thread */
fio_disconnect();
@ -693,25 +699,8 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
if (fio_sync(to_fullpath, FIO_BACKUP_HOST) != 0)
elog(ERROR, "Cannot sync file \"%s\": %s", to_fullpath, strerror(errno));
/* fsync header file */
if (file->external_dir_num == 0 &&
file->is_datafile && !file->is_cfs &&
file->n_headers > 0)
{
char to_fullpath_hdr[MAXPGPATH];
snprintf(to_fullpath_hdr, MAXPGPATH, "%s_hdr", to_fullpath);
if (fio_sync(to_fullpath, FIO_BACKUP_HOST) != 0)
elog(ERROR, "Cannot sync file \"%s\": %s", to_fullpath_hdr, strerror(errno));
}
}
if (fio_sync(current.hdr_map.path, FIO_BACKUP_HOST) != 0)
elog(ERROR, "Cannot sync file \"%s\": %s", current.hdr_map.path, strerror(errno));
time(&end_time);
pretty_time_interval(difftime(end_time, start_time),
pretty_time, lengthof(pretty_time));

View File

@ -250,21 +250,6 @@ delete_file:
elog(ERROR, "Cannot remove file \"%s\": %s", full_path,
strerror(errno));
}
if (file->n_headers > 0)
{
char full_path_hdr[MAXPGPATH];
snprintf(full_path_hdr, MAXPGPATH, "%s_hdr", full_path);
if (remove(full_path_hdr) == -1)
{
if (errno == ENOENT)
return;
elog(ERROR, "Cannot remove file \"%s\": %s", full_path_hdr,
strerror(errno));
}
}
}
/*