Re: BRIN indexes - TRAP: BadArgument

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, Emanuel Calvo <3manuek(at)esdebian(dot)org>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BRIN indexes - TRAP: BadArgument
Date: 2014-11-05 20:54:19
Message-ID: 20141105205419.GI1791@alvin.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Janes wrote:

> At line 252 of brin_xlog.c, should the UnlockReleaseBuffer(metabuf) be
> protected by a BufferIsValid?

Yes, that was just me being careless. Fixed.

> Now I am getting segfaults during normal (i.e. no intentional crashes)
> operations. I think I was seeing them sometimes before as well, I just
> wasn't looking for them.

Interesting. I was neglecting to test for empty index tuples in the
Consistent support function. Should be fixed now, and I verified that
the other support functions check for this condition (AFAICS this was
the only straggler -- I had fixed all the others already).

> I think this is related to having block ranges which have no tuples in them
> when they are first summarized. If I take out the "with t as (delete from
> foo returning *) insert into foo select * from t", then I don't see the
> crashes

Exactly.

After fixing that I noticed that there was an assertion (about
collations) failing under certain conditions with your script. I also
fixed that. I also added a test for regress. I didn't have time to
distill a standalone test case for your crash, though.

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

Attachment Content-Type Size
brin-23.patch text/x-diff 243.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-11-05 21:08:31 Re: WAL format and API changes (9.5)
Previous Message Kevin Grittner 2014-11-05 20:49:22 Re: Repeatable read and serializable transactions see data committed after tx start