Re: ERROR: invalid memory alloc request size - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: ERROR: invalid memory alloc request size
Date
Msg-id 20051027214429.GA19093@surnet.cl
Whole thread Raw
In response to Re: ERROR: invalid memory alloc request size  (Matteo Beccati <php@beccati.com>)
Responses Re: ERROR: invalid memory alloc request size
List pgsql-hackers
Matteo Beccati wrote:
> Tom, Alvaro
>
> >>The remaining question for me is, how do we sleep until the correct
> >>offset has been stored?
> >
> >I was thinking of just pg_usleep for some nominal time (1ms maybe)
> >and try to read the offsets page again.  This is a corner case so
> >the performance doesn't have to be great.
>
> Let me know if you need to test some other patches.

Ok.  I had hoped to reproduce the problem with pristine sources, in
order to verify that I was able to show it not appearing with my patch.
However I have been unable to create a situation in which the problem
appears.  So I attach the patch that I came up with.  Please test it.

I added a loop counter, to verify that we don't loop indefinitely.  I'm
not sure that it's the best way to do it, but I'm too coward to leave it
without any check.

--
Alvaro Herrera                           Developer, http://www.PostgreSQL.org
"La soledad es compañía"

Attachment

pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: enums
Next
From: Tom Lane
Date:
Subject: Re: _penalty gist method invoked with one key NULL