mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2026-06-21 01:34:15 +02:00
[Issue #169] check for interrupt more frequently during restore
This commit is contained in:
+8
-4
@@ -983,10 +983,6 @@ restore_data_file_new(parray *parent_chain, pgFile *dest_file, FILE *out, const
|
||||
|
||||
pgBackup *backup = (pgBackup *) parray_get(parent_chain, i);
|
||||
|
||||
/* check for interrupt */
|
||||
if (interrupted || thread_interrupted)
|
||||
elog(ERROR, "Interrupted during restore");
|
||||
|
||||
/* lookup file in intermediate backup */
|
||||
res_file = parray_bsearch(backup->files, dest_file, pgFileCompareRelPathWithExternal);
|
||||
tmp_file = (res_file) ? *res_file : NULL;
|
||||
@@ -1050,6 +1046,10 @@ restore_data_file_internal(FILE *in, FILE *out, pgFile *file, uint32 backup_vers
|
||||
DataPage page;
|
||||
int32 uncompressed_size = 0;
|
||||
|
||||
/* check for interrupt */
|
||||
if (interrupted || thread_interrupted)
|
||||
elog(ERROR, "Interrupted during data file restore");
|
||||
|
||||
/* read BackupPageHeader */
|
||||
read_len = fread(&header, 1, sizeof(header), in);
|
||||
|
||||
@@ -1207,6 +1207,10 @@ restore_non_data_file_internal(FILE *in, FILE *out, pgFile *file,
|
||||
{
|
||||
read_len = 0;
|
||||
|
||||
/* check for interrupt */
|
||||
if (interrupted || thread_interrupted)
|
||||
elog(ERROR, "Interrupted during non-data file restore");
|
||||
|
||||
if ((read_len = fio_fread(in, buf, sizeof(buf))) != sizeof(buf))
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user