Re: assertion in 9.4 with wal_level=logical

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Steve Singer <steve(at)ssinger(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: assertion in 9.4 with wal_level=logical
Date: 2014-04-18 14:50:55
Message-ID: 20140418145055.GA5822@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
> On Thu, Apr 17, 2014 at 10:47 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> > On 2014-04-17 17:40:01 -0300, Alvaro Herrera wrote:
> >> For once, this looks more like a problem in logical decoding, which is
> >> trying to assert about the tuple being updated; the assertion failing is
> >> the one added a week ago about not palloc'ing in a critical section.
> >
> > It's this (older) assertion in HeapTupleHeaderGetCmax():
> >
> > Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetUpdateXid(tup)));
> >
> > That can allocate memory if xmax is a multixact... Does anybody have a
> > better idea to solve this than adding a CritSectionCount == 0 && in
> > there?
>
> Blech. Isn't that just nerfing the assertion?

Well, that's exactly the point. Most of the time,
HeapTupleHeaderGetCmax gets called in a non-critical section, and we
want to run the assertion in that case. But it's not huge trouble if
the assertion is not run in the rare case where HeapTupleHeaderGetCmax
is being used to write a Xlog record.

It's a bit painful that HeapTupleHeaderGetUpdateXid allocates memory,
but to fix that we would have to remove all allocations from
GetMultiXactIdMembers which doesn't sound feasible.

--
Á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-04-18 14:51:14 Re: assertion in 9.4 with wal_level=logical
Previous Message Robert Haas 2014-04-18 14:44:55 Re: assertion in 9.4 with wal_level=logical