Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeNZ3-0003PE-JD for pgsql-committers@arkaria.postgresql.org; Fri, 30 Sep 2022 21:28:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oeNZ2-00085O-GE for pgsql-committers@arkaria.postgresql.org; Fri, 30 Sep 2022 21:28:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeNZ2-00083a-8p for pgsql-committers@lists.postgresql.org; Fri, 30 Sep 2022 21:28:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeNYz-0003Xl-Je for pgsql-committers@lists.postgresql.org; Fri, 30 Sep 2022 21:28:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 28ULSpVN692792; Fri, 30 Sep 2022 17:28:51 -0400 From: Tom Lane To: Jaime Casanova cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Avoid improbable PANIC during heap_update. In-reply-to: References: Comments: In-reply-to Jaime Casanova message dated "Fri, 30 Sep 2022 15:44:22 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <692790.1664573331.1@sss.pgh.pa.us> Date: Fri, 30 Sep 2022 17:28:51 -0400 Message-ID: <692791.1664573331@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jaime Casanova writes: > Just to confirm I saw this on RC1 Ugh ... I think I see the problem. There's still one path through RelationGetBufferForTuple that fails to guarantee that it's acquired a vmbuffer pin if the all-visible flag becomes set in the otherBuffer. Namely, if we're forced to extend the relation, then we deal with vm pins when ConditionalLockBuffer(otherBuffer) fails ... but not when it succeeds. I think the fix is just to move the last GetVisibilityMapPins call out of the "if (unlikely(!ConditionalLockBuffer(otherBuffer)))" stanza. It'd still be good to have a test case for this ... regards, tom lane