| From: | Gavin Sherry <swm(at)alcove(dot)com(dot)au> | 
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Cc: | pgsql-hackers(at)postgresql(dot)org, Heikki Linnakangas <heikki(at)enterprisedb(dot)com> | 
| Subject: | Re: Arbitary file size limit in twophase.c | 
| Date: | 2008-05-13 14:55:23 | 
| Message-ID: | 20080513145523.GE13136@europa.idg.com.au | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Tue, May 13, 2008 at 10:34:23AM -0400, Tom Lane wrote:
> Gavin Sherry <swm(at)alcove(dot)com(dot)au> writes:
> > There's an apparently arbitary limit of 10,000,000 bytes in twophase.c
> > on the size of a two phase commit file. I can't see why this limit
> > exists.
> 
> The comment seems perfectly clear about why the limit exists:
> 
>      * Check file length.  We can determine a lower bound pretty easily. We
>      * set an upper bound mainly to avoid palloc() failure on a corrupt file.
Oops. Where was my brain?
> Perhaps it'd be better to use malloc() than palloc(), so that we'd not
> lose control on out-of-memory, and then deem the file "too big" only
> if we couldn't malloc the space.
That seems better.
Thanks,
Gavin
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Alvaro Herrera | 2008-05-13 15:08:52 | Re: odd output in restore mode | 
| Previous Message | Alvaro Herrera | 2008-05-13 14:43:02 | Re: psql wrapped format default for backslash-d commands |