diff options
Diffstat (limited to 'src/bin/pg_dump/parallel.c')
-rw-r--r-- | src/bin/pg_dump/parallel.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c index bc5251be824..c9f6b86bb05 100644 --- a/src/bin/pg_dump/parallel.c +++ b/src/bin/pg_dump/parallel.c @@ -250,10 +250,7 @@ init_parallel_dump_utils(void) /* Initialize socket access */ err = WSAStartup(MAKEWORD(2, 2), &wsaData); if (err != 0) - { - pg_log_error("%s() failed: error code %d", "WSAStartup", err); - exit_nicely(1); - } + pg_fatal("%s() failed: error code %d", "WSAStartup", err); parallel_init_done = true; } @@ -393,7 +390,7 @@ archive_close_connection(int code, void *arg) * * Note that we don't expect to come here during normal exit (the workers * should be long gone, and the ParallelState too). We're only here in a - * fatal() situation, so intervening to cancel active commands is + * pg_fatal() situation, so intervening to cancel active commands is * appropriate. */ static void @@ -961,7 +958,7 @@ ParallelBackupStart(ArchiveHandle *AH) /* Create communication pipes for this worker */ if (pgpipe(pipeMW) < 0 || pgpipe(pipeWM) < 0) - fatal("could not create communication channels: %m"); + pg_fatal("could not create communication channels: %m"); /* leader's ends of the pipes */ slot->pipeRead = pipeWM[PIPE_READ]; @@ -1018,7 +1015,7 @@ ParallelBackupStart(ArchiveHandle *AH) else if (pid < 0) { /* fork failed */ - fatal("could not create worker process: %m"); + pg_fatal("could not create worker process: %m"); } /* In Leader after successful fork */ @@ -1148,8 +1145,8 @@ parseWorkerCommand(ArchiveHandle *AH, TocEntry **te, T_Action *act, Assert(*te != NULL); } else - fatal("unrecognized command received from leader: \"%s\"", - msg); + pg_fatal("unrecognized command received from leader: \"%s\"", + msg); } /* @@ -1191,8 +1188,8 @@ parseWorkerResponse(ArchiveHandle *AH, TocEntry *te, AH->public.n_errors += n_errors; } else - fatal("invalid message received from worker: \"%s\"", - msg); + pg_fatal("invalid message received from worker: \"%s\"", + msg); return status; } @@ -1323,10 +1320,10 @@ lockTableForWorker(ArchiveHandle *AH, TocEntry *te) res = PQexec(AH->connection, query->data); if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) - fatal("could not obtain lock on relation \"%s\"\n" - "This usually means that someone requested an ACCESS EXCLUSIVE lock " - "on the table after the pg_dump parent process had gotten the " - "initial ACCESS SHARE lock on the table.", qualId); + pg_fatal("could not obtain lock on relation \"%s\"\n" + "This usually means that someone requested an ACCESS EXCLUSIVE lock " + "on the table after the pg_dump parent process had gotten the " + "initial ACCESS SHARE lock on the table.", qualId); PQclear(res); destroyPQExpBuffer(query); @@ -1412,7 +1409,7 @@ ListenToWorkers(ArchiveHandle *AH, ParallelState *pstate, bool do_wait) { /* If do_wait is true, we must have detected EOF on some socket */ if (do_wait) - fatal("a worker process died unexpectedly"); + pg_fatal("a worker process died unexpectedly"); return false; } @@ -1429,8 +1426,8 @@ ListenToWorkers(ArchiveHandle *AH, ParallelState *pstate, bool do_wait) pstate->te[worker] = NULL; } else - fatal("invalid message received from worker: \"%s\"", - msg); + pg_fatal("invalid message received from worker: \"%s\"", + msg); /* Free the string returned from getMessageFromWorker */ free(msg); @@ -1534,7 +1531,7 @@ sendMessageToLeader(int pipefd[2], const char *str) int len = strlen(str) + 1; if (pipewrite(pipefd[PIPE_WRITE], str, len) != len) - fatal("could not write to the communication channel: %m"); + pg_fatal("could not write to the communication channel: %m"); } /* @@ -1611,7 +1608,7 @@ getMessageFromWorker(ParallelState *pstate, bool do_wait, int *worker) } if (i < 0) - fatal("%s() failed: %m", "select"); + pg_fatal("%s() failed: %m", "select"); for (i = 0; i < pstate->numWorkers; i++) { @@ -1652,7 +1649,7 @@ sendMessageToWorker(ParallelState *pstate, int worker, const char *str) if (pipewrite(pstate->parallelSlot[worker].pipeWrite, str, len) != len) { - fatal("could not write to the communication channel: %m"); + pg_fatal("could not write to the communication channel: %m"); } } |