mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-03 14:01:57 +02:00
[Issue #228]: remove artefacts of previous implementation
This commit is contained in:
parent
e80f1fe432
commit
a7eb948a75
27
src/backup.c
27
src/backup.c
@ -596,8 +596,14 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* close block header map */
|
/* close block header map */
|
||||||
if (current.hdr_map.fp && fclose(current.hdr_map.fp))
|
if (current.hdr_map.fp)
|
||||||
elog(ERROR, "Cannot close file \"%s\"", current.hdr_map.path);
|
{
|
||||||
|
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 */
|
/* close ssh session in main thread */
|
||||||
fio_disconnect();
|
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)
|
if (fio_sync(to_fullpath, FIO_BACKUP_HOST) != 0)
|
||||||
elog(ERROR, "Cannot sync file \"%s\": %s", to_fullpath, strerror(errno));
|
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);
|
time(&end_time);
|
||||||
pretty_time_interval(difftime(end_time, start_time),
|
pretty_time_interval(difftime(end_time, start_time),
|
||||||
pretty_time, lengthof(pretty_time));
|
pretty_time, lengthof(pretty_time));
|
||||||
|
15
src/dir.c
15
src/dir.c
@ -250,21 +250,6 @@ delete_file:
|
|||||||
elog(ERROR, "Cannot remove file \"%s\": %s", full_path,
|
elog(ERROR, "Cannot remove file \"%s\": %s", full_path,
|
||||||
strerror(errno));
|
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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user