pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor and generalize the ParallelSlot machinery.
Date: Thu, 11 Mar 2021 19:02:10 +0000
Message-ID: <E1lKQZW-0004eJ-5k@gemulon.postgresql.org> (raw)

Refactor and generalize the ParallelSlot machinery.

Create a wrapper object, ParallelSlotArray, to encapsulate the
number of slots and the slot array itself, plus some other relevant
bits of information. This reduces the number of parameters we have
to pass around all over the place.

Allow for a ParallelSlotArray to contain slots connected to
different databases within a single cluster. The current clients
of this mechanism don't need this, but it is expected to be used
by future patches.

Defer connecting to databases until we actually need the connection
for something. This is a slight behavior change for vacuumdb and
reindexdb. If you specify a number of jobs that is larger than the
number of objects, the extra connections will now not be used.
But, on the other hand, if you specify a number of jobs that is
so large that it's going to fail, the failure would previously have
happened before any operations were actually started, and now it
won't.

Mark Dilger, reviewed by me.

Discussion: http://postgr.es/m/12ED3DA8-25F0-4B68-937D-D907CFBF08E7@enterprisedb.com
Discussion: http://postgr.es/m/BA592F2D-F928-46FF-9516-2B827F067F57@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f71519e545a34ece0a27c8bb1a2b6e197d323163

Modified Files
--------------
src/bin/scripts/reindexdb.c          |  17 +-
src/bin/scripts/vacuumdb.c           |  46 ++--
src/fe_utils/parallel_slot.c         | 407 ++++++++++++++++++++++++-----------
src/include/fe_utils/parallel_slot.h |  27 ++-
src/tools/pgindent/typedefs.list     |   2 +
5 files changed, 338 insertions(+), 161 deletions(-)



Message-ID: <E1lKQZW-0004eJ-5k@gemulon.postgresql.org>
Permalink:  ../E1lKQZW-0004eJ-5k@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lKQZW-0004eJ-5k@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: rhaas@postgresql.org
  Subject: Re: pgsql: Refactor and generalize the ParallelSlot machinery.
  In-Reply-To: <E1lKQZW-0004eJ-5k@gemulon.postgresql.org>
  References: <E1lKQZW-0004eJ-5k@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