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 1mlfUD-0004mn-DX for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Nov 2021 22:57:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mlfUC-0006TT-2M for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Nov 2021 22:57:32 +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 1mlfUB-0006TK-QK for pgsql-bugs@lists.postgresql.org; Fri, 12 Nov 2021 22:57:31 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlfU9-0007il-Gu for pgsql-bugs@lists.postgresql.org; Fri, 12 Nov 2021 22:57:30 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id B3E8F3200A5F; Fri, 12 Nov 2021 17:57:27 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 12 Nov 2021 17:57:28 -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=mMSnOMf/rZI+w+amlEcOaSyxNdU jLboCpKoBl+MX434=; b=ZLyFGHEuTKBZqZ2pg/f9aMkHzw4V1E2+Q/nWsH+FlET I1nZZKee3vaJK1SngDOrmHntIXR/CpRwoEJYfmHiAg3Kqp7U0lTDClfvY0EuYQOS Y9b2+uASoO+XSf0RN5cUYBMsLXg7IhN/PFmlnCr1/vYEHkzoEhBqf4OPnTTpmv0l pmgSq1/gXLKLRukzH/9L3A2X8RH3A4rLegnNgjnzdomS4ePZ05lFlyrLsSxXCC3P 7ImabDdct+MVKbsqfwBE6/DqqTv2z/jypgSfOMxUQY99HQI6ypNz6Gr0Hq8X0uwE dK6EpuVc7YOYHL44tu/j0SfIn1ShU3woMBpxqFqGOOQ== 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=mMSnOM f/rZI+w+amlEcOaSyxNdUjLboCpKoBl+MX434=; b=CSlppe7FGVgpJ82gFi3v/A UEB3DJinAr9kZtazbihuDVBzcMJOwSQo0KThAhLSvaTdxG6Yx7hSR70b5kZwkuE8 8ux3FIZ583hwjWMwDbc7Vii2MMtJxgj2JoWxRO4Cvdv3n2zeVCMOmZbCJ9bn6i6f F2Tw0+byuDc2LJ4CdRZVwwNyrVXxQx5IR/9u197SYqkqXKHsiqloSm2jj56qxQZF jIHsZseDTQ9+pZn6bIcX9jDc6M2BemHAOlsZtjxFfT/He26LLQRSN/acOEkDtsrc jVkFgBEeO47I5hEJ4LTOXYbn0yWWQOd2Sx99xs9XPA0s8YXHyH6RgZaOR4SwGWeQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvdeggddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeffhfeu ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 12 Nov 2021 17:57:26 -0500 (EST) Date: Fri, 12 Nov 2021 14:57:25 -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: <20211112225725.2a32slgl5ou3dvre@alap3.anarazel.de> References: <20211111030821.2xxl75qfkynaga4j@alap3.anarazel.de> <20211112222919.e7fkfpbpcoje6hsj@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-12 14:46:22 -0800, Peter Geoghegan wrote: > On Fri, Nov 12, 2021 at 2:29 PM Andres Freund wrote: > > With subtransactions abort is a bit more complicated than with plain > > transactions. I'm not at all sure a problematic scenario exists, but I > > wouldn't want to rely on it. > > What would it actually mean to rely on it, or to not rely on it? That we shouldn't throw an error / assert out if we find such a tuple. > As I've pointed out many times already, a disconnected heap tuple > cannot be accessed from an index scan -- this is something that you > *can* rely on, because we've performed exactly the same steps as > heap_hot_search_buffer() would in making that determination. Yes, it'd also not be considered visible by SatisfiesMVCC(). > When you talk about what HTSV thinks of the tuple, you're merely talking > about how to behave in the event of a specific form of HOT chain corruption > (a theoretical background risk for HOT chains that's nothing new). My point is that I don't think it necessarily signals corruption. But a very short term transient state under heavy concurrency. > We need to be pragmatic here. There is some uncertainty about what > HTSV might say about a disconnected tuple in the absence of > corruption, or there is a risk of a new problem like that coming up in > the future -- let's work within those confines, then. What do you want > to do about that? There aren't that many choices, since, to repeat, > the tuple is "morally" DEAD no matter what. Even with corruption, even > without corruption in the presence of some unanticipated corner case > with HTSV -- this is fundamental. I think we can assert/error out if it's visible, that's clearly corruption. I'd personally not add assert/error checks for other states, given that it could plausible happen without indicating a problem. Debugging transient errors that happen rarely, under high load, with nontrivial workloads isn't fun. Greetings, Andres Freund