Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403)

Kyotaro Horiguchi <horikyota.ntt@gmail.com>

From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: er@xs4all.nl
Cc: boekewurm+postgres@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2022-04-01T08:28:52Z
Lists: pgsql-hackers
At Wed, 30 Mar 2022 17:58:24 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in 
> At Wed, 30 Mar 2022 11:46:13 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in 
> > But, in the first place the *fix* has been found to be wrong.  I'm
> > going to search for the right fix..
> 
> FETCH uses the snapshot at DECLARE. So anyhow I needed to set the
> queryDesk's snapshot used in PortalRunSelect to the FETCH's portal's
> holdSnapshot.  What I did in this version is:

By the way, this is, given that the added check in init_toast_snapshot
is valid, a long-standing "bug", which at least back to 12.

I'm not sure what to do for this.

1. ignore the check for certain cases?

2. apply any fix only to master and call it a day.  14 and earlier
  doesn't have the assertion check so they don't complain.

3. apply a fix to all affected versions.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



Commits

  1. Fix incorrect logic in HaveRegisteredOrActiveSnapshot().

  2. Fix temporary object cleanup failing due to toast access without snapshot.

  3. Account for catalog snapshot in PGXACT->xmin updates.