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 1iwZNF-0000XB-Ft for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Jan 2020 22:30:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iwZND-0000yY-RX for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Jan 2020 22:30:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iwZND-0000yR-JW for pgsql-bugs@lists.postgresql.org; Tue, 28 Jan 2020 22:30:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iwZN9-0000rF-5X for pgsql-bugs@lists.postgresql.org; Tue, 28 Jan 2020 22:30:19 +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 00SMTxDZ029584; Tue, 28 Jan 2020 17:29:59 -0500 From: Tom Lane To: Tomas Vondra cc: Andres Freund , Oleksii Kliukin , pgsql-bugs@lists.postgresql.org, ildus@adjust.com, Chris Travers , Nick Babadzhanian , julian.schauder@gmx.de Subject: Re: postgres crash on concurrent update of inheritance partitioned table In-reply-to: <20200128170755.bq3f27bfkjpt4d4b@development> References: <20200128170755.bq3f27bfkjpt4d4b@development> Comments: In-reply-to Tomas Vondra message dated "Tue, 28 Jan 2020 18:07:55 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29582.1580250599.1@sss.pgh.pa.us> Date: Tue, 28 Jan 2020 17:29:59 -0500 Message-ID: <29583.1580250599@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tomas Vondra writes: > On Tue, Jan 28, 2020 at 05:17:14PM +0100, Oleksii Kliukin wrote: >> We have experienced a few crashes a day since upgrading to pg 12.1 last >> week, during the process of updating an inheritance-partitioned table by >> several concurrent sessions. > Yeah, I can reproduce it too. If I had to guess, I'd say it's another > bug due to > commit 3fb307bc4a76815f96fec28a0d1525ab3fbbcfb4 > Author: Andres Freund > Date: Mon Sep 9 05:21:30 2019 -0700 > Reorder EPQ work, to fix rowmark related bugs and improve efficiency. > which introduced relsubs_done et al, and perhaps did not get the life > cycle / resetting right. Not sure. Yup, that's it exactly. EvalPlanQualStart was expecting to reuse relsubs_rowmark and relsubs_done, but that storage will be recycled by EvalPlanQualEnd because it's in the query context of the recheckestate. AFAICS the re-use has no semantic value, so I just got rid of it. regards, tom lane