Skip to content

Commit a7eb948

Browse files
committed
[Issue #228]: remove artefacts of previous implementation
1 parent e80f1fe commit a7eb948

File tree

2 files changed

+8
-34
lines changed

2 files changed

+8
-34
lines changed

src/backup.c

+8-19
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,14 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
596596
}
597597

598598
/* close block header map */
599-
if (current.hdr_map.fp && fclose(current.hdr_map.fp))
600-
elog(ERROR, "Cannot close file \"%s\"", current.hdr_map.path);
599+
if (current.hdr_map.fp)
600+
{
601+
if (fclose(current.hdr_map.fp))
602+
elog(ERROR, "Cannot close file \"%s\"", current.hdr_map.path);
603+
604+
if (fio_sync(current.hdr_map.path, FIO_BACKUP_HOST) != 0)
605+
elog(ERROR, "Cannot sync file \"%s\": %s", current.hdr_map.path, strerror(errno));
606+
}
601607

602608
/* close ssh session in main thread */
603609
fio_disconnect();
@@ -693,25 +699,8 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
693699

694700
if (fio_sync(to_fullpath, FIO_BACKUP_HOST) != 0)
695701
elog(ERROR, "Cannot sync file \"%s\": %s", to_fullpath, strerror(errno));
696-
697-
/* fsync header file */
698-
if (file->external_dir_num == 0 &&
699-
file->is_datafile && !file->is_cfs &&
700-
file->n_headers > 0)
701-
{
702-
char to_fullpath_hdr[MAXPGPATH];
703-
704-
snprintf(to_fullpath_hdr, MAXPGPATH, "%s_hdr", to_fullpath);
705-
706-
if (fio_sync(to_fullpath, FIO_BACKUP_HOST) != 0)
707-
elog(ERROR, "Cannot sync file \"%s\": %s", to_fullpath_hdr, strerror(errno));
708-
709-
}
710702
}
711703

712-
if (fio_sync(current.hdr_map.path, FIO_BACKUP_HOST) != 0)
713-
elog(ERROR, "Cannot sync file \"%s\": %s", current.hdr_map.path, strerror(errno));
714-
715704
time(&end_time);
716705
pretty_time_interval(difftime(end_time, start_time),
717706
pretty_time, lengthof(pretty_time));

src/dir.c

-15
Original file line numberDiff line numberDiff line change
@@ -250,21 +250,6 @@ pgFileDelete(pgFile *file, const char *full_path)
250250
elog(ERROR, "Cannot remove file \"%s\": %s", full_path,
251251
strerror(errno));
252252
}
253-
254-
if (file->n_headers > 0)
255-
{
256-
char full_path_hdr[MAXPGPATH];
257-
258-
snprintf(full_path_hdr, MAXPGPATH, "%s_hdr", full_path);
259-
260-
if (remove(full_path_hdr) == -1)
261-
{
262-
if (errno == ENOENT)
263-
return;
264-
elog(ERROR, "Cannot remove file \"%s\": %s", full_path_hdr,
265-
strerror(errno));
266-
}
267-
}
268253
}
269254

270255
/*

0 commit comments

Comments
 (0)