On Wed, 12 Dec 2012 12:27:11 +0100
Andres Freund <andres@2ndquadrant.com> wrote:
> On 2012-12-12 03:04:19 -0800, David Gould wrote:
> >
> > COPY IN loops in heap_multi_insert() extending the table until it fills the
> Heh. Nice one. Did you hit that in practice?
Yeah, with a bunch of hosts that run postgres on a ramdisk, and that copy
happens late in the initial setup script for new hosts. The first batch of
new hosts to be setup with 9.2 filled the ramdisk, oomed and fell over
within a minute. Since the script setups up a lot of stuff we had no idea
at first who oomed.
> ISTM this would be fixed with a smaller footprint by just making
>
> if (PageGetHeapFreeSpace(page) < MAXALIGN(heaptup->t_len) + saveFreeSpace)
>
> if (!PageIsEmpty(page) &&
> PageGetHeapFreeSpace(page) < MAXALIGN(heaptup->t_len) + saveFreeSpace)
>
> I think that should work?
I like PageIsEmpty() better (and would have used if I I knew), but I'm not
so crazy about the negation.
-dg
--
David Gould 510 282 0869 daveg@sonic.net
If simplicity worked, the world would be overrun with insects.