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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
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-13 11:54:26
Message-ID: CA+TgmoYSJQTHepxC03GWGMBtAhHuDh4hq0_YLxrT1xLPRAP=9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Thu, Oct 12, 2017 at 7:31 PM, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>> Wouldn't this last "if" test, to cover the pg_upgrade case, be better
>> targeted by comparing *raw* xmin to FrozenTransactionId? You're using
>> the potentially distinct xmin value returned by
>> HeapTupleHeaderGetXmin() for the test here. I think we should be
>> directly targeting tuples frozen on or before 9.4 (prior to
>> pg_upgrade) instead.
>
> Yes, agreed, I should change that. Thanks for continuing to think about
> this.

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. The design principle I followed in writing the
original patch was that marking a tuple HEAP_XMIN_FROZEN was identical
to setting the xmin to 2 except that the original xmin was still
available for manual inspection. If we're finding that we need the
raw xmin after freezing, doesn't that mean that our freezing algorithm
was flat busted prior to that commit? And maybe still busted when
things wrap around multiple times and raw-xmins are reused?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-10-13 15:26:35 Re: pgsql: Improve performance of SendRowDescriptionMessage.
Previous Message Andres Freund 2017-10-13 07:39:14 Re: pgsql: Improve performance of SendRowDescriptionMessage.

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-10-13 12:09:55 Re: Continuous integration on Windows?
Previous Message Simon Riggs 2017-10-13 10:30:38 Re: Fix a typo in execReplication.c