Re: postgresql 9.6 - cannot freeze committed xmax

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Alexandre Garcia <alexandre(at)vmfarms(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: postgresql 9.6 - cannot freeze committed xmax
Date: 2018-02-28 23:30:19
Message-ID: 20180228233019.qydod7ez3xbgn5ot@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Alexandre Garcia wrote:
> >
> > Ooh.
> >
> > If you SELECT FOR UPDATE a tuple in 9.2, bit 0x0040 gets set in
> > infomask, and nothing else. If you pg_upgrade and later try to freeze
> > such a tuple, it will fail with the error reported.
> >
> > The correct test to use is HEAP_XMAX_IS_LOCKED_ONLY, which also tests
> > for the above condition.
> >
> > I will verify this theory and push a patch shortly, if it proves
> > correct.
>
> Oh good news :). I have my old 9.2 around if you need me to do more
> testing on it.

Not necessary -- I reproduced the problem (quite easily -- just SELECT
FOR UPDATE a tuple in 9.2, then pg_upgrade, then VACUUM FREEZE the table
in the upgraded server) and confirm that it doesn't happen in 9.6.6,
happens in 9.6.8 (didn't try 9.6.7 but code is the same as 9.6.8), and
is fixed with the attached patch.

Will push soon ... probably tomorrow as I have to leave the building
now.

Cheers

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

Attachment Content-Type Size
0001-Fix-freeze-xmax-bug.patch text/plain 876 bytes

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Andres Freund 2018-02-28 23:49:44 Re: postgresql 9.6 - cannot freeze committed xmax
Previous Message Alexandre Garcia 2018-02-28 23:05:02 Re: postgresql 9.6 - cannot freeze committed xmax