summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_archiver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.c')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 8ffd8f7cad1..ad8e1329b1a 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -2326,6 +2326,9 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
return AH;
}
+/*
+ * Write out all data (tables & blobs)
+ */
void
WriteDataChunks(ArchiveHandle *AH, ParallelState *pstate)
{
@@ -2343,15 +2346,18 @@ WriteDataChunks(ArchiveHandle *AH, ParallelState *pstate)
{
/*
* If we are in a parallel backup, then we are always the master
- * process.
+ * process. Dispatch each data-transfer job to a worker.
*/
EnsureIdleWorker(AH, pstate);
- Assert(GetIdleWorker(pstate) != NO_SLOT);
DispatchJobForTocEntry(AH, pstate, te, ACT_DUMP);
}
else
WriteDataChunksForTocEntry(AH, te);
}
+
+ /*
+ * If parallel, wait for workers to finish.
+ */
EnsureWorkersFinished(AH, pstate);
}
@@ -3819,13 +3825,11 @@ restore_toc_entries_parallel(ArchiveHandle *AH, ParallelState *pstate,
par_list_remove(next_work_item);
- Assert(GetIdleWorker(pstate) != NO_SLOT);
DispatchJobForTocEntry(AH, pstate, next_work_item, ACT_RESTORE);
}
else
{
/* at least one child is working and we have nothing ready. */
- Assert(!IsEveryWorkerIdle(pstate));
}
for (;;)