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 1mkyFe-0001KZ-K4 for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Nov 2021 00:47:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mkyFc-0008Pi-HC for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Nov 2021 00:47:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkyFb-0008PY-BZ for pgsql-bugs@lists.postgresql.org; Thu, 11 Nov 2021 00:47:36 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkyFX-0001s0-TY for pgsql-bugs@lists.postgresql.org; Thu, 11 Nov 2021 00:47:33 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7B5F75C029B; Wed, 10 Nov 2021 19:47:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 10 Nov 2021 19:47:30 -0500 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=fm3; bh=iTVeiAk5bwziYP4r/F80pzup5MR YNm1EB/C6eHAx8Ds=; b=mrMUUotgE2pvhXR23bU/eatQ7tD6QHvegB0C/5iyTb8 zIPEPHJp6CcpffHahslw6DhC1me7xUJSED/WX+pg/lZdZOyj38GBYf+Ah/xnMGAE 93csThvnFFSP6o5nbC77hBzlBUt0nqa5iYYwQieE3nl5w1WLTVrvlNVGJwCgkvE6 stKYydNfcFKBr+w7prNTd6bhF6X7UZqgNQH8J6UBnQyxBVp1dxgVHqTAH8+R6TJ6 +HEI2iyOGY+JO83fBN+EcYQ0WOwd7l88uRtQw7YsVhXusHk8XrEagCpet4zRQ1Rr SV3PJC5mot9t/yCnzZ//Y3Y1JPshRMqvhxw+HFR4OZQ== 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=fm1; bh=iTVeiA k5bwziYP4r/F80pzup5MRYNm1EB/C6eHAx8Ds=; b=lfnr0DriT7XkM3noGUZQtq 7CW3hRiUzyP+JJ+SnhmQQ/ehLrLnaQUquyadTpp7HdG1TpFdgw/zLUn+/3szvh2J m1OA72LUV0n/7duCqa0+SilADWznCZRRVf2E9hZji/96nFiFmaYYWmY9kZe4dmae sO0hURBwx3qbQNccnnCi19TIyo0n+FvL2sbRynpSDArwzUv0ZPJRVzKlqpQEjZpe L4LvYnSkD/mnoQ8eLh7qbMQm/ohynt8BQDefhEZQ1WmAnQ7uR9jYCDZ4gkF4L3Cz LbusTQOHOTcEol7eassd/3Cv5BhGaZRlo5iGA77tOsFGJX1TK2TLhTWLfwcOo2iw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvddtgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeffhfeu ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Nov 2021 19:47:29 -0500 (EST) Date: Wed, 10 Nov 2021 16:47:27 -0800 From: Andres Freund To: Peter Geoghegan Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Alexander Lakhin , Matthias van de Meent , PostgreSQL mailing lists Subject: Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum Message-ID: <20211111004727.imn7xrimdiyo7vfv@alap3.anarazel.de> References: <20211030213948.3i3f7cieqxzhd7kq@alap3.anarazel.de> <20211031192051.e3r2uxft3bulymrr@localhost> <08c2445c-c3c9-ba45-18d3-6399707d8306@gmail.com> <20211108172852.pvsarxoxi54uatch@localhost> <20211109150216.fgfybn35mwnkeef3@localhost> <20211110192010.ckvfzz352hsba5xf@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-11-10 13:04:43 -0800, Peter Geoghegan wrote: > On Wed, Nov 10, 2021 at 11:20 AM Andres Freund wrote: > > The way this definitely breaks - I have been able to reproduce this in > > isolation - is when one tuple is processed twice by heap_prune_chain(), and > > the result of HeapTupleSatisfiesVacuum() changes from > > HEAPTUPLE_DELETE_IN_PROGRESS to DEAD. > > I had no idea that that was now possible. I really think that this > ought to be documented centrally. Where would you suggest? > The relevant code in pruneheap.c was always incredibly fragile -- no > question. Even still, there is really no good reason to believe that > that was actually a problem before commit dc7420c2. Even if we assume > that there's a problem before 14, the surface area is vastly smaller > than on 14 -- the relevant pruneheap.c code hasn't really ever changed > since HOT went in. And so I think that the most sensible course of > action here is this: commit a fix to Postgres 14 + HEAD only -- no > backpatch to earlier versions. Yea. The fact that I also saw *one* error in 13 worries me a bit, but perhaps that was something else. Even if we eventually need to backpatch something further, having it in 14/master first is good. The fact that 13 didn't trigger the problem reliably doesn't necessarily much - it's a pretty limited workload. There e.g. are no aborts. I think we might be able to do something a bit more limited than what you propose. But I'm not sure it's worth going for that. Greetings, Andres Freund