Re: [COMMITTERS] pgsql: Fix traversal of half-frozen update chains

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Fix traversal of half-frozen update chains
Date: 2017-10-17 10:02:00
Message-ID: 20171017100200.ruszi2c6qqwetce5@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Robert Haas wrote:

> I haven't really followed this thread in depth, but I'm very nervous
> about the idea that we should ever be examining the raw-xmin of a
> tuple that has been marked HEAP_XMIN_FROZEN for anything other than
> forensic purposes.

Yeah, me too. If you see another way to fix the problem, let's discuss
it.

I think a possible way is to avoid considering that the relfrozenxid
value computed by the caller is final. Something like this: if page
freezing sees that there is a HOT chain which would end up half-frozen
because of that freeze age, decrease the freeze xid enough that the
whole chain remains unfrozen; communicate the new value to caller so
that it is used as the true new relfrozenxid going forwards. That
preserves the HOT chain intact so that it can be pruned and frozen
correctly in a later VACUUM call. Need to be careful about HOT chains
containing members that are old enough to cause a long term problem
(i.e. a table where relfrozenxid doesn't move forward enough).

One thing I didn't quite investigate is why this bug only shows up with
multixacts so far. Is it just because multixacts provide an easy way to
reproduce it, and that there are others, more difficult ways to cause
the same problem without involving multixacts? If so, then the problem
is likely present in 9.2 as well.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2017-10-17 10:40:59 Re: pgsql: Fix traversal of half-frozen update chains
Previous Message Alvaro Herrera 2017-10-17 09:48:31 pgsql: REASSIGN OWNED BY doc: s/privileges/membership/

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-10-17 10:40:59 Re: pgsql: Fix traversal of half-frozen update chains
Previous Message Alvaro Herrera 2017-10-17 07:51:33 Re: SIGSEGV in BRIN autosummarize