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 1ngSil-0000Yt-Pu for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Apr 2022 14:51:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ngSik-0005NU-LD for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Apr 2022 14:51:18 +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 1ngSik-0005NL-Bn for pgsql-hackers@lists.postgresql.org; Mon, 18 Apr 2022 14:51:18 +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 1ngSie-0003d3-Ch for pgsql-hackers@lists.postgresql.org; Mon, 18 Apr 2022 14:51:18 +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 23IEp8xl2272033; Mon, 18 Apr 2022 10:51:08 -0400 From: Tom Lane To: Andres Freund cc: Robert Haas , Justin Pryzby , Kyotaro Horiguchi , Erik Rijkers , Matthias van de Meent , PostgreSQL Hackers Subject: Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403) In-reply-to: <20220418143901.mdxs53vq3g4u2skp@alap3.anarazel.de> References: <1527714.1649957811@sss.pgh.pa.us> <1535399.1649963150@sss.pgh.pa.us> <1542208.1649967960@sss.pgh.pa.us> <1971135.1650134559@sss.pgh.pa.us> <20220417133112.phzg25rs66w5zipv@alap3.anarazel.de> <2131038.1650210718@sss.pgh.pa.us> <20220418143901.mdxs53vq3g4u2skp@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 18 Apr 2022 07:39:01 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2272031.1650293468.1@sss.pgh.pa.us> Date: Mon, 18 Apr 2022 10:51:08 -0400 Message-ID: <2272032.1650293468@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-04-17 11:51:58 -0400, Tom Lane wrote: >> The fact that we have a snapshot at the instant of fetch doesn't prove >> that it existed continually since we fetched the toast reference, >> which seems to be the condition we actually need to assure. > Right. >> (And TBH I see little reason to think that whether the snapshot is the >> CatalogSnapshot or not changes things in any meaningful way.) > It is a meaningful difference, see e.g. the bug referenced above. Well, that's true given the current arrangements for managing CatalogSnapshot; but that doesn't make the CatalogSnapshot any less of a protection when it exists. The direction I was vaguely imagining is that we create some refcount-like infrastructure directly ensuring that once a snapshot is used to read a toast reference, it gets kept around until we dereference or discard that reference. With a scheme like that, there'd be no reason to discriminate against a CatalogSnapshot as being the protective snapshot. (I hasten to add that I have no idea how to make this half-baked plan work, and there may be better solutions anyway.) >> While it's something to worry about, there's no reason to think >> that v15 is any worse than prior versions in this area, is there? >> So I'm inclined to remove this from the list of v15 open items, >> or at least demote the remaining concern to "older bug" status. > Yes. OK, I'll update the open-items page. regards, tom lane