Re: Re: bulk_multi_insert infinite loops with large rows and small fill factors - Mailing list pgsql-hackers

From David Gould
Subject Re: Re: bulk_multi_insert infinite loops with large rows and small fill factors
Date
Msg-id 20121212041731.1159bc85@jekyl.davidgould.org
Whole thread Raw
In response to Re: bulk_multi_insert infinite loops with large rows and small fill factors  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Re: bulk_multi_insert infinite loops with large rows and small fill factors  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
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.



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Re: bulk_multi_insert infinite loops with large rows and small fill factors
Next
From: Heikki Linnakangas
Date:
Subject: Re: Re: bulk_multi_insert infinite loops with large rows and small fill factors