From: Andres Freund <andres@anarazel.de>
To: Greg Nancarrow <gregn4422@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <akapila@postgresql.org>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
Date: Tue, 23 Mar 2021 21:24:29 -0700
Message-ID: <20210324042429.drhhe3xau3qdvald@alap3.anarazel.de> (raw)
In-Reply-To: <CAJcOf-cLdnyYOgWirsRsS+1b-6KnL3uJQ13NPe5_wvD7Tsx=VA@mail.gmail.com>
References: <E1lMiB9-0001c3-SY@gemulon.postgresql.org>
<CA+TgmoY0GdS7POPWB2nG3yiycNeLz05Mw53NunOjn8f8rZZuxw@mail.gmail.com>
<20210323184406.fv7jh5j722ala5lz@alap3.anarazel.de>
<CAJcOf-cLdnyYOgWirsRsS+1b-6KnL3uJQ13NPe5_wvD7Tsx=VA@mail.gmail.com>
Hi,
On 2021-03-24 14:42:44 +1100, Greg Nancarrow wrote:
> On Wed, Mar 24, 2021 at 5:44 AM Andres Freund <andres@anarazel.de> wrote:
> > Shouldn't we have this in IndexOptInfo already?
>
> The additional parallel-safety checks are (at least currently) invoked
> as part of max_parallel_hazard(), which is called early on in the
> planner, so I don't believe that IndexOptInfo/RelOptInfo has been
> built at this point.
Then that's something you need to redesign, not duplicate the effort.
> > But also, why on earth
> > is that WARNING branch a good idea?
> I think there are about half a dozen other places in the Postgres code
> where the same check is done, in which case it calls elog(ERROR,...).
> Is it a better strategy to immediately exit the backend with an error
> in this case, like the other cases do?
Yes.
> My take on it was that if this "should never happen" condition is ever
> encountered, let it back out of the parallel-safety checks and
> error-out in the place it normally (currently) would.
What advantage does that have? You'll get a bunch of WARNINGs before the
ERROR later in optimize, differences between assert-non/assert builds,
more complicated code flow, longer untested code.
Greetings,
Andres Freund
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: andres@anarazel.de, gregn4422@gmail.com, robertmhaas@gmail.com, akapila@postgresql.org
Subject: Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
In-Reply-To: <20210324042429.drhhe3xau3qdvald@alap3.anarazel.de>
References: <E1lMiB9-0001c3-SY@gemulon.postgresql.org> <CA+TgmoY0GdS7POPWB2nG3yiycNeLz05Mw53NunOjn8f8rZZuxw@mail.gmail.com> <20210323184406.fv7jh5j722ala5lz@alap3.anarazel.de> <CAJcOf-cLdnyYOgWirsRsS+1b-6KnL3uJQ13NPe5_wvD7Tsx=VA@mail.gmail.com> <20210324042429.drhhe3xau3qdvald@alap3.anarazel.de>
* 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