pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor parallelization processing code in src/bin/scripts/
Date: Fri, 19 Jul 2019 00:32:19 +0000
Message-ID: <E1hoGot-0002Jy-0j@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5f3840370b63fdf17f704a285623ccc233fa8d4f

Modified Files
--------------
src/bin/scripts/Makefile           |   4 +-
src/bin/scripts/clusterdb.c        |   4 +-
src/bin/scripts/common.c           |  94 ++++++++-
src/bin/scripts/common.h           |  14 +-
src/bin/scripts/reindexdb.c        |   4 +-
src/bin/scripts/scripts_parallel.c | 283 +++++++++++++++++++++++++++
src/bin/scripts/scripts_parallel.h |  36 ++++
src/bin/scripts/vacuumdb.c         | 390 +++----------------------------------
8 files changed, 446 insertions(+), 383 deletions(-)



Message-ID: <E1hoGot-0002Jy-0j@gemulon.postgresql.org>
Permalink:  ../E1hoGot-0002Jy-0j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hoGot-0002Jy-0j@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Refactor parallelization processing code in src/bin/scripts/
  In-Reply-To: <E1hoGot-0002Jy-0j@gemulon.postgresql.org>
  References: <E1hoGot-0002Jy-0j@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox