Re: recovering from "found xmin ... from before relfrozenxid ..."
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Amit Kapila <amit.kapila16@gmail.com>,
Ashutosh Sharma <ashu.coek88@gmail.com>, Mark Dilger <mark.dilger@enterprisedb.com>, Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, "Andrey M. Borodin" <x4mmm@yandex-team.ru>,
MBeena Emerson <mbeena.emerson@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Stephen Frost <sfrost@snowman.net>
Date: 2021-03-15T03:17:28Z
Lists: pgsql-hackers
On Mon, Sep 21, 2020 at 1:11 PM Andres Freund <andres@anarazel.de> wrote: > > I'm not sure I really understand how that's happening, because surely > > HOT chains and non-HOT chains are pruned by the same code, but it > > doesn't sound good. > > Not necessarily, unfortunately: > > case HEAPTUPLE_DEAD: > So if e.g. a transaction aborts between the heap_page_prune and this > check the pruning behaviour depends on whether the tuple is part of a > HOT chain or not. I have a proposal that includes removing this "tupgone = true" special case: https://postgr.es/m/CAH2-Wzm7Y=_g3FjVHv7a85AfUbuSYdggDnEqN1hodVeOctL+Ow@mail.gmail.com Of course this won't change the fact that vacuumlazy.c can disagree with pruning about what is dead -- that is a necessary consequence of having multiple HTSV calls for the same tuple in vacuumlazy.c (it can change in the presence of concurrently aborted transactions). But removing the "tupgone = true" special case does seem much more consistent, and simpler overall. We have lots of code that is only needed to make that special case work. For example, the whole idea of a dedicated XLOG_HEAP2_CLEANUP_INFO record for recovery conflicts can go -- we can get by with only XLOG_HEAP2_CLEAN records from pruning, IIRC. Have I missed something? The special case in question seems pretty awful to me, so I have to wonder why somebody else didn't remove it long ago... -- Peter Geoghegan
Commits
-
Fix wrong data table horizon computation during backend startup.
- 1c7675a7a426 14.0 landed
-
Centralize horizon determination for temp tables, fixing bug due to skew.
- 94bc27b57680 14.0 landed
-
pg_surgery: Try to stabilize regression tests.
- 0811f766fd74 14.0 landed
-
New contrib module, pg_surgery, with heap surgery functions.
- 34a947ca13e5 14.0 landed
-
Set cutoff xmin more aggressively when vacuuming a temporary table.
- a7212be8b9e0 14.0 cited
-
snapshot scalability: Don't compute global horizons while building snapshots.
- dc7420c2c927 14.0 cited
-
Introduce vacuum errcontext to display additional information.
- b61d161c1463 13.0 cited