Re: BUG #17197: Assert failed on inserting index tuples after VACUUM

Alexander Law <exclusion@gmail.com>

From: Alexander Lakhin <exclusion@gmail.com>
To: Peter Geoghegan <pg@bowt.ie>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-09-21T05:00:01Z
Lists: pgsql-bugs
Hello Peter,

21.09.2021 00:03, Peter Geoghegan wrote:
> On Mon, Sep 20, 2021 at 1:35 PM Peter Geoghegan <pg@bowt.ie> wrote:
> Before commit 3c3b8a4b our failing offset number would have at least
> found an LP_UNUSED item -- so no assertion failure. After that commit
> the offset's line pointer might actually be positioned "past the end
> of the line pointer array". But that is a valid state for a heap
> page/HOT chain to have -- so the assertion has it wrong.
>
> I'll push a fix soon. Thanks for the report!
Thanks for the fix!
But if that is a valid (or sane) state, then shouldn't the comment "Some
sanity checks" be removed (or updated) too?

Best regards,
Alexander




Commits

  1. Document issue with heapam line pointer truncation.

  2. Remove overzealous index deletion assertion.

  3. Truncate line pointer array during VACUUM.

  4. Fix index deletion latestRemovedXid bug.