Re: BUG #17245: Index corruption involving deduplicated entries - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: BUG #17245: Index corruption involving deduplicated entries
Date
Msg-id CAH2-Wz=W=osUk9ULhmELcgZkC9jb99MLp_RdoFKJNLABoQtLZw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17245: Index corruption involving deduplicated entries  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: BUG #17245: Index corruption involving deduplicated entries  (Alexander Kukushkin <cyberdemn@gmail.com>)
List pgsql-bugs
On Thu, Oct 28, 2021 at 6:43 PM Peter Geoghegan <pg@bowt.ie> wrote:
> heap_prepare_freeze_tuple() doesn't actually modify anything -- it
> just decides what to do later on, in the "nfrozen > 0" critical
> section back in lazy_scan_prune().

Oh, wait. heap_prepare_freeze_tuple() is advertised as not modifying
anything, but that's kind of a lie, since FreezeMultiXactId() is
called and can sometimes allocate a new MultiXactId. The comments
above heap_prepare_freeze_tuple() never got the memo about this
following one of the big MultiXact bug fixes, "Rework tuple freezing
protocol" (commit 3b97e6823b). My mistake.

Presumably this isn't very different to a hard crash that also
allocates a MultiXactId that never gets used. It should be even rarer
than that. We hardly ever hit the goto path, with or without freezing
or almost-freezing. I see that coverage.postgresql.org says we don't
hit it even once. So I think that this is fine.

-- 
Peter Geoghegan



pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #17245: Index corruption involving deduplicated entries
Next
From: Noah Misch
Date:
Subject: Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data