Re: Add parallelism and glibc dependent only options to reindexdb - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Add parallelism and glibc dependent only options to reindexdb
Date
Msg-id CAOBaU_ZyeFT0SO22KTzCbLYgZppkMnVvUtQKZAe4mJciqSYvyA@mail.gmail.com
Whole thread Raw
In response to Re: Add parallelism and glibc dependent only options to reindexdb  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Sat, Jul 27, 2019 at 3:27 PM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Sat, Jul 27, 2019 at 11:44:47AM +0200, Julien Rouhaud wrote:
> > That's probably still more intuitive than having the count coming from
> > either main() or from get_parallel_object_list() depending on the
> > process type, so I'm fine with that alternative.  Maybe we could bite
> > the bullet and add a count meber to Simple*List, also providing a
> > macro to initialize a new list so that next time a field is added
> > there won't be a massive boilerplate code change?
>
> Perhaps, we could discuss about that on a separate thread.

Agreed.

>   For now I
> have gone with the simplest approach of counting the items, and
> stopping the count if there are more items than jobs.  While reviewing
> I have found a double-free in your patch when building a list of
> relations for schemas or databases.  If the list finishes empty,
> PQfinish() was called twice on the connection, leading to a crash.  I
> have added a test for that

Oops, thanks for spotting and fixing.

> , done an extra pass on the patch adjusting
> a couple of things then committed the patch with the restriction on
> --index and --jobs.  This entry is now marked as committed in the CF
> app.

Thanks!



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Testing LISTEN/NOTIFY more effectively
Next
From: Daniel Migowski
Date:
Subject: Adding column "mem_usage" to view pg_prepared_statements