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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Andreas Seltenreich <seltenreich(at)gmx(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan
Date: 2016-11-21 16:00:58
Message-ID: 19006.1479744058@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
> On Mon, Nov 21, 2016 at 6:10 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>> 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.

I think this is the right fix for the moment, because the proximate cause
of the crash is that ExecSerializePlan doesn't transmit any part of the
PlannedStmt.subplans list, which glob->subplans is the preimage of.

Now, maybe I'm missing something, but it seems to me that ordinary
subplans could be transmitted to workers just fine. The problem with
transmitting initplans is that you'd lose the expectation of single
evaluation. (Even there, it might be okay if they're far enough down
in the plan tree, but I haven't thought about it in detail.) So I'd
rather see us fix ExecSerializePlan to transmit the subplans list
and have some more-restrictive test here. This code would still be
wrong as it stands though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tobias Bussmann 2016-11-21 16:24:55 Re: Parallel execution and prepared statements
Previous Message Amit Kapila 2016-11-21 15:35:36 Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan