From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Alexandre Garcia <alexandre@vmfarms.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: postgresql 9.6 - cannot freeze committed xmax
Date: Wed, 28 Feb 2018 20:30:19 -0300
Message-ID: <20180228233019.qydod7ez3xbgn5ot@alvherre.pgsql> (raw)
In-Reply-To: <CAPYLKR4BqAa-FBM6QoEj8OYZXafu9RUEusoecrpo0ZoBxoY4Wg@mail.gmail.com>
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
Attachments:
0001-Fix-freeze-xmax-bug.patch (text/plain, 0B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: alvherre@alvh.no-ip.org, alexandre@vmfarms.com, andres@anarazel.de
Subject: Re: postgresql 9.6 - cannot freeze committed xmax
In-Reply-To: <20180228233019.qydod7ez3xbgn5ot@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox