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: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Peter Eisentraut <peter(dot)eisentraut(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-12 05:49:13
Message-ID: CAOBaU_bSU+7VR6U9h2dEGdJmL7GGv6+ZqHcw1tvQ_455Jyo=ng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 12, 2019 at 3:20 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Jul 11, 2019 at 06:22:25PM +0200, Julien Rouhaud wrote:
> > I think t hat it makes the code quite cleaner to have the selection
> > outside ConsumeIdleSlot.
>
> Actually, you have an issue with ConsumeIdleSlot() if there is only
> one parallel slot, no? In this case the current patch returns
> immediately the slot available without waiting. I think that we
> should wait until the slot becomes free in that case as well, and
> switch isFree to false.

It shouldn't be a problem, I reused the same infrastructure as for
vacuumdb. so run_reindex_command has a new "async" parameter, so when
there's no parallelism it's using executeMaintenanceCommand (instead
of PQsendQuery) which will block until query completion. That's why
there's no isFree usage at all in this case.

> If you want to keep things splitted, that's
> fine by me, I would still use "Get" within the name for the routine,
> and rename the other to get_idle_slot_internal() or
> get_idle_slot_guts() to point out that it has an internal role.

Ok, I'll change to get_idle_slot_internal then.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Igal Sapir 2019-07-12 05:54:53 Re: Unknown type name bool
Previous Message Michael Paquier 2019-07-12 05:27:21 Re: Unknown type name bool