Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan
Date
Msg-id CAA4eK1+0MUZUvMNuO6SLzjEwD2KVWssDL3G=AiBHHQTzxWnm1w@mail.gmail.com
Whole thread Raw
In response to Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Nov 21, 2016 at 6:10 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Sun, Nov 20, 2016 at 10:43 PM, Andreas Seltenreich
> <seltenreich@gmx.de> wrote:
>> Hi,
>>
>> the query below triggers a parallel worker assertion for me when run on
>> the regression database of master as of 0832f2d.  The plan sports a
>> couple of InitPlan nodes below Gather.
>>
>
> I think the reason of this issue is that in some cases where subplan
> is at some node other than top_plan node, we allow them to be executed
> in the worker in force_parallel_mode.  It seems to me that the
> problematic code is below check in standard_planner()
>
> if (force_parallel_mode != FORCE_PARALLEL_OFF &&
> best_path->parallel_safe &&
> top_plan->initPlan == NIL)
>
> Here instead of checking whether top_plan has initPlan, it should
> check whether initPlan is present anywhere in plan tree.  I think one
> simple way could be to check *glob->subplans* instead of
> top_plan->initPlan,
>

Patch based on above suggestion is attached with this mail.

Thoughts?


--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [sqlsmith] Parallel worker crash on seqscan
Next
From: Tom Lane
Date:
Subject: Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan