Re: patch for parallel pg_dump
От | Joachim Wieland |
---|---|
Тема | Re: patch for parallel pg_dump |
Дата | |
Msg-id | CACw0+11sQ=8uxL8t0hRMTioZ-i1Gqu5gAbhvrcas=o7f-34Ntw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: patch for parallel pg_dump (Alvaro Herrera <alvherre@commandprompt.com>) |
Ответы |
Re: patch for parallel pg_dump
|
Список | pgsql-hackers |
On Wed, Mar 28, 2012 at 2:20 PM, Alvaro Herrera <alvherre@commandprompt.com> wrote: > My main comment about the current patch is that it looks like it's > touching pg_restore parallel code by moving some stuff into parallel.c. > If that's really the case and its voluminous, maybe this patch would > shrink a bit if we could do the code moving in a first patch. That > would be mostly mechanical. Then the interesting stuff would apply on > top of that. That would make review easier. Unfortunately this is not really the case. What is being moved out of pg_backup_archiver.c and into parallel.c is either the shutdown logic that has been applied only a few days ago or is necessary to change the parallel restore logic from one-thread-per-dump-object to the message passing framework where a worker starts in the beginning and then receives a new dump object from the master every time it's idle. Instead now I split up the patch into two parts. The first part does not depend on the parallel functionality and can be applied already now. The second part then adds the parallelism on top. Here's the complete list of changes of the first patch: - split up restore_toc_entries_parallel into restore_toc_entries_prefork / restore_toc_entries_parallel and restore_toc_entries_postfork - remove static char from prependDirectory - remove static PQExpBuffer from fmtCopyColumnList - get the relPages numbers, add a function that sorts by tablesize (not called right now) - remove static char* from selectSourceSchema - function getThreadLocalPQExpBuffer returning a PQExpBuffer that lives in thread-local memory - make fmtId use the thread-local PQExpBuffer - add function fmtQualifiedId which is schema + fmtId() - add function pointer on_exit_msg_func, that will be called to handle the last words of a process (currently it only prints the message) - change exit_nicely to not modify the global variable on_exit_nicely_index - move ropt->number_of_jobs from RestoreOptions to AHX->numWorkers so that it can be used for backup as well - make getTocEntryByDumpId non-static, even though it's not necessary now - make CloneArchive / DeCloneArchive non-static, even though it's not necessary now - if a transaction is active in DisconnectDatabase, cancel this transaction with PQcancel
Вложения
В списке pgsql-hackers по дате отправления: