Re: BRIN indexes - TRAP: BadArgument

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, 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-07 23:32:58
Message-ID: CAApHDvqnWasC_+Y_Gswvdd8=kQVTajS45C=M9aZmBhqi9ULXoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 8, 2014 at 8:56 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
wrote:

>
> I just pushed this, after some more minor tweaks. Thanks, and please do
> continue testing!
>
>
I'm having problems getting this to compile on MSVC. Attached is a patch
which fixes the problem.

There also seems to be a bit of a problem with:

brin.c(250): warning C4700: uninitialized local variable 'newsz' used

/*
* Before releasing the lock, check if we can attempt a same-page
* update. Another process could insert a tuple concurrently in
* the same page though, so downstream we must be prepared to cope
* if this turns out to not be possible after all.
*/
samepage = brin_can_do_samepage_update(buf, origsz, newsz);

LockBuffer(buf, BUFFER_LOCK_UNLOCK);

newtup = brin_form_tuple(bdesc, heapBlk, dtup, &newsz);

Here newsz is passed to brin_can_do_samepage_update before being
initialised. I'm not quite sure of the solution here as I've not spent much
time looking at it, but perhaps brin_form_tuple needs to happen before
brin_can_do_samepage_update, then the lock should be released? I didn't
change this in the patch as I'm not sure if that's the proper fix or not.

The attached should fix the build problem that anole is having:
http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=anole&dt=2014-11-07%2022%3A04%3A03

Regards

David Rowley

Attachment Content-Type Size
brin_elog_fix.diff text/plain 440 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kouhei Kaigai 2014-11-07 23:33:30 Re: [v9.5] Custom Plan API
Previous Message Robert Haas 2014-11-07 22:46:46 Re: [v9.5] Custom Plan API