public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andres Freund <[email protected]>
To: Tom Lane <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Justin Pryzby <[email protected]>
Cc: Kyotaro Horiguchi <[email protected]>
Cc: Erik Rijkers <[email protected]>
Cc: Matthias van de Meent <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)
Date: Mon, 18 Apr 2022 07:39:01 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CA+TgmoYKWXhYRRSHwMTo-N48i64jOvq1yYmwrz7vHKFGnOyy8Q@mail.gmail.com>
	<[email protected]>
	<CA+Tgmob93_YftfhrSF+OpNWXWtv2bq774yBH3JxPiJf=-DxoiA@mail.gmail.com>
	<[email protected]>
	<CA+Tgmoap=U6yeftFb4-EbMQ1xAXE8ZZ+_GRAkTwx4L+jr+zNoA@mail.gmail.com>
	<[email protected]>
	<[email protected]! ail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>

Hi,

On 2022-04-17 11:51:58 -0400, Tom Lane wrote:
> Andres Freund <[email protected]> writes:
> > On 2022-04-16 14:42:39 -0400, Tom Lane wrote:
> >> I think (based on the above argument) that what it intends to enforce
> >> is not really the system design we need, but it certainly isn't
> >> helping anyone that it enforces that design incorrectly.
> 
> > I think it's approximately right for the current caller. But that caller
> > likely needs an improved design around snapshots...
> 
> Yeah, I think the real issue is that checking
> HaveRegisteredOrActiveSnapshot in this way doesn't provide a very
> good guarantee of what we really want to know, which is that the
> session's advertised xmin is old enough to prevent removal of
> whatever toast data we're trying to fetch.

Right. It's better than what was there before though - I added
HaveRegisteredOrActiveSnapshot() in the course of
7c38ef2a5d6cf6d8dc3834399d7a1c364d64ce64. Where the problem was that we
didn't have *any* snapshot other than the catalog snapshot, and the
catalog snapshot only sometimes (iirc for that bug it depended on the
order in which objects were deleted).  That makes such bugs much harder
to detect.


> 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.


> I don't yet see a practical way to check for the real concern.
> 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.

Greetings,

Andres Freund






view thread (27+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox