]> granicus.if.org Git - postgresql/commit
Refactor parallelization processing code in src/bin/scripts/
authorMichael Paquier <michael@paquier.xyz>
Fri, 19 Jul 2019 00:31:58 +0000 (09:31 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 19 Jul 2019 00:31:58 +0000 (09:31 +0900)
commit5f3840370b63fdf17f704a285623ccc233fa8d4f
tree194f7e1322dc8fb871b853e516a13e12e96a81de
parentb538c90b1bded5464787e2b8e4431302d24eb601
Refactor parallelization processing code in src/bin/scripts/

The existing facility of vacuumdb to handle parallel connections into a
given database with an authentication set is moved to a common file in
src/bin/scripts/, named scripts_parallel.c.  This introduces a set of
routines to initialize, wait and terminate a set of connections,
simplifying a bit the code of vacuumdb on the way.  More routines
related to result handling and database connection are moved to
common.c.

The initial plan is to use that for reindexdb, but it could be applied
to other tools like clusterdb.

While on it, clean up a set of variables "progname" which were defined
as routine arguments for error messages.  Since most of the callers have
switched to pg_log_error() and such there is no need for this variable.

Author: Julien Rouhaud
Reviewed-by: Michael Paquier, Álvaro Herrera
Discussion: https://postgr.es/m/CAOBaU_YrnH_Jqo46NhaJ7uRBiWWEcS40VNRQxgFbqYo9kApUsg@mail.gmail.com
src/bin/scripts/Makefile
src/bin/scripts/clusterdb.c
src/bin/scripts/common.c
src/bin/scripts/common.h
src/bin/scripts/reindexdb.c
src/bin/scripts/scripts_parallel.c [new file with mode: 0644]
src/bin/scripts/scripts_parallel.h [new file with mode: 0644]
src/bin/scripts/vacuumdb.c