Re: BRIN indexes - TRAP: BadArgument - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: BRIN indexes - TRAP: BadArgument
Date
Msg-id 20141105205419.GI1791@alvin.alvh.no-ip.org
Whole thread Raw
In response to Re: BRIN indexes - TRAP: BadArgument  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: BRIN indexes - TRAP: BadArgument  (Jeff Janes <jeff.janes@gmail.com>)
List 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

pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Repeatable read and serializable transactions see data committed after tx start
Next
From: Heikki Linnakangas
Date:
Subject: Re: WAL format and API changes (9.5)