Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8r3I-0005f3-6P for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Nov 2016 16:02:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c8r3G-0006vU-HC for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Nov 2016 16:02:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c8r1q-0005M4-4P for pgsql-hackers@postgresql.org; Mon, 21 Nov 2016 16:01:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c8r1m-0000ss-Fb for pgsql-hackers@postgresql.org; Mon, 21 Nov 2016 16:01:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uALG0wFh019007; Mon, 21 Nov 2016 11:00:58 -0500 From: Tom Lane To: Amit Kapila cc: Andreas Seltenreich , pgsql-hackers Subject: Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan In-reply-to: References: <8737im6pmh.fsf@credativ.de> Comments: In-reply-to Amit Kapila message dated "Mon, 21 Nov 2016 21:05:36 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19005.1479744058.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Nov 2016 11:00:58 -0500 Message-ID: <19006.1479744058@sss.pgh.pa.us> X-Pg-Spam-Score: -4.9 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Amit Kapila writes: > On Mon, Nov 21, 2016 at 6:10 PM, Amit Kapila wr= ote: >> 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 --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers