Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2oDr-0002Na-FX for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Aug 2019 03:02:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i2oDq-0006cc-68 for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Aug 2019 03:02:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2oDp-0006c4-2u for pgsql-bugs@lists.postgresql.org; Wed, 28 Aug 2019 03:02:09 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i2oDm-0003jR-3A for pgsql-bugs@lists.postgresql.org; Wed, 28 Aug 2019 03:02:08 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 92E9121F6D; Tue, 27 Aug 2019 23:02:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 27 Aug 2019 23:02:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=iJ4qC3P8iEgbbezBtr/I9Jb9mrX /8ig/l0eak5Y4xcE=; b=lhX52+9qSzs56czCAeqZ88HV1Us0fO5zUWAnwNW9GeR UmXc8r7no2Q3seeGF4FTwL9WozMwNZqRB0DK1lx4fxoaKBhdHiY1PddATw4dWGTP KzABtPNLNgPXe7A1RermXGTmE5FxiaYF7whlh+Du5d1/F5aJxRgxxpFecXLNIWDI Ni91my1BTWTZxXa8SmHZI78gZz8TIJQ1GJpHDfAfi8Rb8KgFUpk+arhpdru17k/4 LprEOUR0WgP9xFPkGVHgQ9EdDpEC9jOHDCJHedK+WuKn/6fsd6a+MgTQWIe1mE5p 7OYBo1fGIHTOMy8eMzoQlXqPCgLNTRBj3WyO2z5puVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=iJ4qC3 P8iEgbbezBtr/I9Jb9mrX/8ig/l0eak5Y4xcE=; b=jkwn4EWXvGGw4DIv1kIxFP GD0LWiQNdcxR6topbi86HoIb/Wwz9m9PvzoVE0iUQtTwVNRSxAY7SgUmAeDRdUNt swd1FDPH7Wd3ypvBfLJCeoNRsszShdnKjrqPNO3B9P3qIcekpHnjKlJl2cgL+AV4 /15+8Ae2aSS9eKAzriuS1NObPH31GiQNa2I7DZ3QCs8pcsrhH9XXaSf6c0ur61Tt ljOiaT58TOlya6AfhzUK/on1goOhToITQkUKprYZUqxFh9oubN82e/VvgVZH8SwB 6yyB8JqbsQ4OByCiPcGktB2aUCOoJVmWZyNZKyTeq/8ubrGklK3PqEVJE1jEQfcQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudehledgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtre dttddtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghn rghrrgiivghlrdguvgeqnecukfhppeeijedrudeitddrvddukedrvdefjeenucfrrghrrg hmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggvnecuvehluhhs thgvrhfuihiivgeptd X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-218-237.hsd1.ca.comcast.net [67.160.218.237]) by mail.messagingengine.com (Postfix) with ESMTPA id A68008005B; Tue, 27 Aug 2019 23:02:02 -0400 (EDT) Date: Tue, 27 Aug 2019 20:02:01 -0700 From: Andres Freund To: Tom Lane Cc: yi huang , pgsql-bugs@lists.postgresql.org Subject: Re: PostgreSQL12 crash bug report Message-ID: <20190828030201.v5u76ty47mtw2efp@alap3.anarazel.de> References: <20811.1564344681@sss.pgh.pa.us> <28807.1564614449@sss.pgh.pa.us> <20190801004000.3xis75ulpun4ha3p@alap3.anarazel.de> <5285.1564627060@sss.pgh.pa.us> <20190801043658.4hqm7k3iarmq3q7i@alap3.anarazel.de> <29185.1566663202@sss.pgh.pa.us> <20190824225401.gii25wnxwxtx6evg@alap3.anarazel.de> <20190826053652.a5a6bdsgtus7xcez@alap3.anarazel.de> <20190827010847.zdk6xvu6h3ty5v42@alap3.anarazel.de> <17374.1566925597@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17374.1566925597@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-08-27 13:06:37 -0400, Tom Lane wrote: > > Tom, everyone, what do you think of the attached approach? It > > implements what I described upthread. > > Seems reasonable to store a pointer in the EPQState rather than pass > that as a separate argument, but I think you need a bit more documentation > work to keep the two EState pointers from being impossibly confusing. Agreed. > Also I dislike the field name "es_active_epq", as what that suggests > to me is exactly backwards from the way you apparently are using it. > Maybe "es_parent_epq" instead? The comment for it is pretty opaque > as well, not to mention that it misspells EState. I think what I was trying to signal was that EPQ is currently active from the POV of executor nodes. Ought to have been es_epq_active, for that, I guess. For me "if (estate->es_epq_active)" explains the meaning of the check more than "if (estate->es_parent_epq)". > I don't agree with the FIXME comment in execnodes.h. The rowmarks > state is used for things that are outside of EPQ, particularly the > actual row locking ;-), so I wouldn't want to move that even if it > didn't create notational issues. Yea, I wasn't sure about that. > I'm confused by the removal of the EvalPlanQualBegin call at > nodeModifyTable.c:1373 ... why is that OK? EvalPlanQual() calls EvalPlanQualBegin(), it was just needed to initiate enough state to be able to get a slot. > The original intent of EvalPlanQualInit was to do an absolutely > minimal amount of work, since we don't know yet whether EPQ will > ever be needed (and, generally, the way to bet is that it won't be). > You've added some pallocs and list-to-array conversion, which > while not terribly expensive still seem like they don't belong > there. Can't we move most of that to EvalPlanQualBegin? I see that > we want the substitute_slot array to exist so that EvalPlanQualSlot > can work without EvalPlanQualBegin, but if we're postponing > non-locking-rowmark work then we don't need the rest. Yea, we can move the other fields without much trouble. > > - Should the RTI indexed version of arowmarks be computed as an array > > directly in nodeModifyTable.c etc? Right now we build it first as a > > list, and then convert it as an array? We could also just use an rti > > indexed List, and store NULLs where there are no RTIs? But there's no > > good API for that. > > Do that as a follow-on patch if at all. I'm not sure it's worth changing. Well, it'd at least partially address your concern above that we ought to do less work during EvalPlanQualInit - if we had it in array form we'd just need to set a variable, rather than do the transformation. Greetings, Andres Freund