mirror of
https://github.com/postgres/postgres.git
synced 2025-05-01 01:04:50 +03:00
Fix missing abort checks in pg_backup_directory.c.
Parallel restore from directory format failed to respond to control-C in a timely manner, because there were no checkAborting() calls in the code path that reads data from a file and sends it to the backend. If any worker was in the midst of restoring data for a large table, you'd just have to wait. This fix doesn't do anything for the problem of aborting a long-running server-side command, but at least it fixes things for data transfers. Back-patch to 9.3 where parallel restore was introduced.
This commit is contained in:
parent
210981a4a9
commit
3c8aa6654a
@ -406,7 +406,12 @@ _PrintFileData(ArchiveHandle *AH, char *filename)
|
|||||||
buflen = ZLIB_OUT_SIZE;
|
buflen = ZLIB_OUT_SIZE;
|
||||||
|
|
||||||
while ((cnt = cfread(buf, buflen, cfp)))
|
while ((cnt = cfread(buf, buflen, cfp)))
|
||||||
|
{
|
||||||
|
/* Are we aborting? */
|
||||||
|
checkAborting(AH);
|
||||||
|
|
||||||
ahwrite(buf, 1, cnt, AH);
|
ahwrite(buf, 1, cnt, AH);
|
||||||
|
}
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
if (cfclose(cfp) !=0)
|
if (cfclose(cfp) !=0)
|
||||||
@ -543,6 +548,9 @@ _ReadBuf(ArchiveHandle *AH, void *buf, size_t len)
|
|||||||
{
|
{
|
||||||
lclContext *ctx = (lclContext *) AH->formatData;
|
lclContext *ctx = (lclContext *) AH->formatData;
|
||||||
|
|
||||||
|
/* Are we aborting? */
|
||||||
|
checkAborting(AH);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there was an I/O error, we already exited in cfread(), so here we
|
* If there was an I/O error, we already exited in cfread(), so here we
|
||||||
* exit on short reads.
|
* exit on short reads.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user