Re: Add parallelism and glibc dependent only options to reindexdb

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Daniel Verite <daniel(at)manitou-mail(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Kevin Grittner <kgrittn(at)gmail(dot)com>
Subject: Re: Add parallelism and glibc dependent only options to reindexdb
Date: 2019-07-09 12:56:37
Message-ID: CAOBaU_abD08HAxwnx3jGPuBV4POUMmvC_GdMn2qM_+PXsq6f+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 9, 2019 at 9:52 AM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:
>
> On Tue, Jul 9, 2019 at 9:24 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> >
> > I have done a lookup of this patch set with a focus on the refactoring
> > part, and the split is a bit confusing.
> [...]

I finished to do a better refactoring, and ended up with this API in
scripts_parallel:

extern ParallelSlot *ConsumeIdleSlot(ParallelSlot *slots, int numslots,
const char *progname);

extern ParallelSlot *SetupParallelSlots(const char *dbname, const char *host,
const char *port,
const char *username, bool prompt_password,
const char *progname, bool echo,
PGconn *conn, int numslots);

extern bool WaitForSlotsCompletion(ParallelSlot *slots, int numslots,
const char *progname);

ConsumeIdleSlot() being a wrapper on top of (now static) GetIdleSlot,
which handles parallelism and possible failure.

Attached v3, including updated documentation for the new -j option.

Attachment Content-Type Size
0002-Add-parallel-processing-to-reindexdb-v3.patch application/octet-stream 17.4 KB
0001-Export-vacuumdb-s-parallel-infrastructure-v3.patch application/octet-stream 22.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Patrick McHardy 2019-07-09 13:00:27 [PATCH] Fix trigger argument propagation to child partitions
Previous Message Ryan Lambert 2019-07-09 12:39:39 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)