Re: ERROR: found unexpected null value in index
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Andres Freund <andres@anarazel.de>,
Manuel Rigger <rigger.manuel@gmail.com>,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-07-10T20:02:50Z
Lists: pgsql-bugs
Attachments
- fix-get_actual_variable_range-for-HOT-chains-wip.patch (text/x-diff) patch
Peter Geoghegan <pg@bowt.ie> writes: > On Tue, Jul 9, 2019 at 7:47 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Hm. So maybe we need to teach it to ignore tuples that are not the tips >> of their HOT chains? > An approach like that was the first thing that I thought of, but I'll > have to study the problem some more before coming up with a firm > opinion. I experimented with the attached. It solves the reported problem and passes check-world. I made it just ignore any tuple for which HeapTupleHeaderIsHotUpdated is true. It might seem like there's a risk of ignoring valid data, if the end tuple of a HOT chain is dead due to a transaction abort, but since HeapTupleHeaderIsHotUpdated checks for xmax validity I judge that the risk of that is small enough to be acceptable. A bigger problem with this is that in the tableam world, this seems like a complete disaster modularity-wise. I think it won't actually fail --- non-heap AMs are probably not returning BufferHeapTupleTableSlots, and even if they are, they shouldn't be marking tuples HOT_UPDATED unless that concept applies to them. But it sure seems like this leaves get_actual_variable_range() knowing way more than it ought to about storage-level concerns. Should we try to transpose some of this logic to below the AM API, and if so, what should that look like? regards, tom lane
Commits
-
Fix get_actual_variable_range() to cope with broken HOT chains.
- d3751adcf14d 13.0 landed
- cee976c4e8c4 12.0 landed
- 5c1b7edc23a0 11.5 landed
-
Improve performance of get_actual_variable_range with recently-dead tuples.
- 3ca930fc39cc 11.0 cited