#include "postgres_fe.h"
#include <sys/select.h>
#include <sys/wait.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include "fe_utils/string_utils.h"
#include "parallel.h"
#include "pg_backup_utils.h"
Go to the source code of this file.
Definition at line 228 of file parallel.c.
Definition at line 74 of file parallel.c.
Definition at line 139 of file parallel.c.
Definition at line 71 of file parallel.c.
Definition at line 72 of file parallel.c.
Definition at line 85 of file parallel.c.
Definition at line 186 of file parallel.c.
Enumerator | |
---|---|
WRKR_NOT_STARTED | |
WRKR_IDLE | |
WRKR_WORKING | |
WRKR_TERMINATED |
Definition at line 77 of file parallel.c.
Definition at line 341 of file parallel.c.
References ParallelSlot::AH, ShutdownInformation::AHX, arg, closesocket, DisconnectDatabase(), GetMyPSlot(), ParallelSlot::pipeRevRead, ParallelSlot::pipeRevWrite, ShutdownInformation::pstate, _archiveHandle::public, and ShutdownWorkersHard().
Referenced by on_exit_close_archive().
Definition at line 1110 of file parallel.c.
References ACT_DUMP, ACT_RESTORE, Assert(), buf, _tocEntry::dumpId, and snprintf.
Referenced by DispatchJobForTocEntry().
Definition at line 1158 of file parallel.c.
References buf, _tocEntry::dumpId, Archive::n_errors, _archiveHandle::public, snprintf, and WORKER_IGNORED_ERRORS.
Referenced by WaitForCommands().
Definition at line 1207 of file parallel.c.
References buf, buildWorkerCommand(), ParallelSlot::callback, callback(), ParallelSlot::callback_data, GetIdleWorker(), NO_SLOT, ParallelState::parallelSlot, sendMessageToWorker(), ParallelState::te, WaitForWorkers(), WFW_ONE_IDLE, ParallelSlot::workerStatus, and WRKR_WORKING.
Referenced by restore_toc_entries_parallel(), and WriteDataChunks().
Definition at line 1238 of file parallel.c.
References i, NO_SLOT, ParallelState::numWorkers, ParallelState::parallelSlot, ParallelSlot::workerStatus, and WRKR_IDLE.
Referenced by DispatchJobForTocEntry(), and WaitForWorkers().
Definition at line 1518 of file parallel.c.
References PIPE_READ, and readMessageFromPipe().
Referenced by WaitForCommands().
Definition at line 1581 of file parallel.c.
References Assert(), do_wait, i, ParallelState::numWorkers, ParallelState::parallelSlot, pg_fatal, ParallelSlot::pipeRead, readMessageFromPipe(), select, select_loop(), WORKER_IS_RUNNING, and ParallelSlot::workerStatus.
Referenced by ListenToWorkers().
Definition at line 266 of file parallel.c.
References i, ParallelState::numWorkers, ParallelState::parallelSlot, and ParallelSlot::pid.
Referenced by archive_close_connection().
Definition at line 1254 of file parallel.c.
References i, ParallelState::numWorkers, ParallelState::parallelSlot, WORKER_IS_RUNNING, and ParallelSlot::workerStatus.
Referenced by WaitForTerminatingWorkers().
Definition at line 238 of file parallel.c.
References err(), and pg_fatal.
Referenced by main().
Definition at line 1270 of file parallel.c.
References i, ParallelState::numWorkers, ParallelState::parallelSlot, ParallelSlot::workerStatus, and WRKR_IDLE.
Referenced by ParallelBackupEnd(), restore_toc_entries_parallel(), and WaitForWorkers().
Definition at line 1400 of file parallel.c.
References ParallelSlot::callback, ParallelSlot::callback_data, do_wait, free, getMessageFromWorker(), messageStartsWith, ParallelState::parallelSlot, parseWorkerResponse(), pg_fatal, ParallelState::te, ParallelSlot::workerStatus, and WRKR_IDLE.
Referenced by WaitForWorkers().
Definition at line 1303 of file parallel.c.
References appendPQExpBuffer(), _archiveHandle::connection, createPQExpBuffer(), PQExpBufferData::data, _tocEntry::desc, destroyPQExpBuffer(), fmtQualifiedId(), pg_fatal, PGRES_COMMAND_OK, PQclear, PQexec(), PQresultStatus, and _tocEntry::tag.
Referenced by WaitForCommands().
Definition at line 330 of file parallel.c.
References ShutdownInformation::AHX, archive_close_connection(), on_exit_nicely(), and shutdown_info.
Referenced by main().
Definition at line 1061 of file parallel.c.
References Assert(), closesocket, free, i, IsEveryWorkerIdle(), ParallelState::numWorkers, ParallelState::parallelSlot, ParallelSlot::pipeRead, ParallelSlot::pipeWrite, ShutdownInformation::pstate, set_cancel_pstate(), shutdown_info, ParallelState::te, and WaitForTerminatingWorkers().
Referenced by _CloseArchive(), and RestoreArchive().
Definition at line 899 of file parallel.c.
References DumpSignalInformation::am_worker, Assert(), closesocket, _archiveHandle::connection, getLocalPQExpBuffer, i, j, ParallelState::numWorkers, Archive::numWorkers, ParallelState::parallelSlot, pg_fatal, pg_malloc(), pg_malloc0(), pgpipe, ParallelSlot::pid, PIPE_READ, PIPE_WRITE, ParallelSlot::pipeRead, ParallelSlot::pipeRevRead, ParallelSlot::pipeRevWrite, ParallelSlot::pipeWrite, pqsignal, ShutdownInformation::pstate, _archiveHandle::public, RunWorker(), set_archive_cancel_info(), set_cancel_pstate(), shutdown_info, signal_info, SIGPIPE, ParallelState::te, ParallelSlot::workerStatus, and WRKR_IDLE.
Referenced by _CloseArchive(), and RestoreArchive().
Definition at line 1125 of file parallel.c.
References ACT_DUMP, ACT_RESTORE, Assert(), getTocEntryByDumpId(), messageStartsWith, and pg_fatal.
Referenced by WaitForCommands().
Definition at line 1173 of file parallel.c.
References Assert(), _tocEntry::dumpId, messageStartsWith, Archive::n_errors, pg_fatal, and _archiveHandle::public.
Referenced by ListenToWorkers().
Definition at line 1664 of file parallel.c.
References Assert(), bufsize, fd(), pg_free(), pg_malloc(), pg_realloc(), and piperead.
Referenced by getMessageFromLeader(), and getMessageFromWorker().
Definition at line 831 of file parallel.c.
References CloneArchive(), DeCloneArchive(), DisconnectDatabase(), PIPE_READ, PIPE_WRITE, ParallelSlot::pipeRevRead, ParallelSlot::pipeRevWrite, _archiveHandle::public, set_cancel_slot_archive(), _archiveHandle::SetupWorkerPtr, and WaitForCommands().
Referenced by ParallelBackupStart().
Definition at line 1542 of file parallel.c.
References EINTR, i, and select.
Referenced by getMessageFromWorker().
Definition at line 1529 of file parallel.c.
References len, pg_fatal, PIPE_WRITE, pipewrite, and str.
Referenced by WaitForCommands().
Definition at line 1646 of file parallel.c.
References len, ParallelState::parallelSlot, pg_fatal, ParallelSlot::pipeWrite, pipewrite, and str.
Referenced by DispatchJobForTocEntry().
Definition at line 732 of file parallel.c.
References conn, _archiveHandle::connCancel, DumpSignalInformation::myAH, PQfreeCancel(), PQgetCancel(), set_cancel_handler(), and signal_info.
Referenced by ConnectDatabaseAhx(), DisconnectDatabase(), and ParallelBackupStart().
Definition at line 610 of file parallel.c.
References DumpSignalInformation::handler_set, pqsignal, signal_info, SIGQUIT, and sigTermHandler().
Referenced by set_archive_cancel_info().
Definition at line 791 of file parallel.c.
References DumpSignalInformation::pstate, and signal_info.
Referenced by ParallelBackupEnd(), and ParallelBackupStart().
Definition at line 811 of file parallel.c.
References ParallelSlot::AH.
Referenced by RunWorker().
Definition at line 397 of file parallel.c.
References ParallelSlot::AH, closesocket, _archiveHandle::connCancel, i, kill, ParallelState::numWorkers, ParallelState::parallelSlot, ParallelSlot::pid, ParallelSlot::pipeWrite, PQcancel(), and WaitForTerminatingWorkers().
Referenced by archive_close_connection().
Definition at line 547 of file parallel.c.
References DumpSignalInformation::am_worker, _archiveHandle::connCancel, i, kill, DumpSignalInformation::myAH, ParallelState::numWorkers, ParallelState::parallelSlot, ParallelSlot::pid, PQcancel(), pqsignal, progname, DumpSignalInformation::pstate, signal_info, SIGQUIT, and write_stderr.
Referenced by set_cancel_handler().
Definition at line 1338 of file parallel.c.
References ACT_DUMP, ACT_RESTORE, Assert(), buf, buildWorkerResponse(), free, getMessageFromLeader(), lockTableForWorker(), parseWorkerCommand(), sendMessageToLeader(), _archiveHandle::WorkerJobDumpPtr, and _archiveHandle::WorkerJobRestorePtr.
Referenced by RunWorker().
Definition at line 448 of file parallel.c.
References Assert(), free, HasEveryWorkerTerminated(), j, ParallelState::numWorkers, ParallelState::parallelSlot, pg_malloc(), ParallelSlot::pid, ParallelState::te, WORKER_IS_RUNNING, ParallelSlot::workerStatus, and WRKR_TERMINATED.
Referenced by ParallelBackupEnd(), and ShutdownWorkersHard().
Definition at line 1453 of file parallel.c.
References Assert(), do_wait, GetIdleWorker(), IsEveryWorkerIdle(), ListenToWorkers(), mode, NO_SLOT, WFW_ALL_IDLE, WFW_GOT_STATUS, WFW_NO_WAIT, and WFW_ONE_IDLE.
Referenced by DispatchJobForTocEntry(), restore_toc_entries_parallel(), and WriteDataChunks().
Definition at line 154 of file parallel.c.
Referenced by on_exit_close_archive(), ParallelBackupEnd(), and ParallelBackupStart().
Definition at line 175 of file parallel.c.
Referenced by ParallelBackupStart(), set_archive_cancel_info(), set_cancel_handler(), set_cancel_pstate(), and sigTermHandler().