Re: [sqlsmith] PANIC: failed to add BRIN tuple - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [sqlsmith] PANIC: failed to add BRIN tuple
Date
Msg-id 20160527223008.GA735540@alvherre.pgsql
Whole thread Raw
In response to Re: [sqlsmith] PANIC: failed to add BRIN tuple  (Andreas Seltenreich <seltenreich@gmx.de>)
Responses Re: [sqlsmith] PANIC: failed to add BRIN tuple
List pgsql-hackers
Andreas Seltenreich wrote:
> I wrote:
>
> > Re-fuzzing now with your patch applied.
>
> This so far yielded three BRIN core dumps on different machines with the
> same backtraces.  Crash recovery fails in these cases.
>
> I've put the data directory here (before recovery):
>
>     http://ansel.ydns.eu/~andreas/brincrash2-spidew.tar.xz (9.1M)
>
> Corresponding backtraces of the backend and startup core files below.

Ah, of course.  These two crashes are two different bugs: the xlog one
is because I forgot to attach the new PageAddItem() flag to the
corresponding replay code; and the one in regular running is because I
neglected to have the patched PageAddItem() compute pd_lower correctly,
which in effect left pages as if empty.

I came up with a simple-minded test program (attached) which reproduces
the reported crashes in a couple of seconds; it can be improved further
for stronger BRIN testing, but at least with this I am confident that
the crashes at hand are gone.  If you can re-run sqlsmith and see if you
can find different bugs, I'd appreciate it.

I'm not going to push this just yet, in order to give others time to
comment on the new PageAddItemFlags API I'm adding.

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

Attachment

pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: copyParamList
Next
From: Alvaro Herrera
Date:
Subject: new PageAddItemFlags()