Re: MultiXactId error after upgrade to 9.3.4

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: MultiXactId error after upgrade to 9.3.4
Date: 2014-03-31 11:54:53
Message-ID: 20140331115452.GT9567@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost wrote:
> * Stephen Frost (sfrost(at)snowman(dot)net) wrote:
> > I have the pre-upgrade database and can upgrade/rollback/etc that pretty
> > easily. Note that the table contents weren't changed during the
> > upgrade, of course, and so the 9.2.6 instance has HEAP_XMAX_IS_MULTI set
> > while t_xmax is 6849409 for the tuple in question- even though
> > pg_controldata reports NextMultiXactId as 1601462 (and it seems very
> > unlikely that there's been a wraparound on that in this database..).
>
> Further review leads me to notice that both HEAP_XMAX_IS_MULTI and
> HEAP_XMAX_INVALID are set:
>
> t_infomask | 6528
>
> 6528 decimal -> 0x1980
>
> 0001 1001 1000 0000
>
> Which gives us:
>
> 0000 0000 1000 0000 - HEAP_XMAX_LOCK_ONLY
> 0000 0001 0000 0000 - HEAP_XMIN_COMMITTED
> 0000 1000 0000 0000 - HEAP_XMAX_INVALID
> 0001 0000 0000 0000 - HEAP_XMAX_IS_MULTI
>
> Which shows that both HEAP_XMAX_INVALID and HEAP_XMAX_IS_MULTI are set.

My conclusion here is that some part of the code is failing to examine
XMAX_INVALID before looking at the value stored in xmax itself. There
ought to be a short-circuit. Fortunately, this bug should be pretty
harmless.

.. and after looking, I'm fairly sure the bug is in
heap_tuple_needs_freeze.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-03-31 11:57:13 Re: MultiXactId error after upgrade to 9.3.4
Previous Message Thom Brown 2014-03-31 10:32:11 Re: B-Tree support function number 3 (strxfrm() optimization)