Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Andreas Seltenreich <seltenreich(at)gmx(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan
Date: 2016-11-21 12:40:16
Message-ID: CAA4eK1KHO2bVkeiDuRmruwZs-VqNRmqRmiVcN6PRfW1HpgPrpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 20, 2016 at 10:43 PM, Andreas Seltenreich
<seltenreich(at)gmx(dot)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, another possibility is to traverse the whole tree
to see if initPlan is present.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2016-11-21 12:54:03 Re: Remove the comment on the countereffectiveness of large shared_buffers on Windows
Previous Message Ashutosh Sharma 2016-11-21 12:16:33 Re: [sqlsmith] Parallel worker crash on seqscan