Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Bowen Shi <zxwsbg12138(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae
Date: 2024-05-16 20:13:35
Message-ID: CAH2-WzkpqV5hUUnbn1BsMaZt45EMA6RNeyP62cuZ3C-XagAjUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, May 16, 2024 at 3:39 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> Hm, were the cases you observed that way using parallel vacuuming? And what
> index types were involved?

They definitely didn't use parallel VACUUM, since autovacuum was
involved in all cases. Only B-Tree indexes were involved. There were
plenty of index page deletions involved, since the underlying workload
involved bulk deletions. Deletions that seemed to leave every heap
page without any heap tuples.

Partitioning also happened to be involved. No particular reason to
suspect that that matters, though.

> Melanies reproducer works because there are catalog accesses that can trigger
> a recomputation of fuzzy horizon. For testing the "easy" window for that is
> the vac_open_indexes() < 16, because it happens after determining the horizon,
> but before actually vacuuming.

What about the call to GetOldestNonRemovableTransactionId() that takes
place in _bt_pendingfsm_finalize()?

> Now I wonder if there is some codepath triggering catalog lookups during bulk
> delete.

I don't think that there's any rule that says that VACUUM cannot do
catalog lookups during bulk deletions. B-Tree page deletion needs to
generate an insertion scan key, so that it can "refind" a page
undergoing deletion. That might require catalog lookups.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2024-05-16 20:29:49 Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae
Previous Message Andres Freund 2024-05-16 20:03:53 Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae