Re: BufFileWrite across MAX_PHYSICAL_FILESIZE boundary

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kurt Harriman <kharriman(at)greenplum(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: BufFileWrite across MAX_PHYSICAL_FILESIZE boundary
Date: 2007-05-17 04:25:42
Message-ID: 20070517042541.GQ4582@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
>
> This has been saved for the 8.4 release:
>
> http://momjian.postgresql.org/cgi-bin/pgpatches_hold

Huh, no, this is a bug and should be fixed right away.

> ---------------------------------------------------------------------------
>
> Tom Lane wrote:
> > "Kurt Harriman" <kharriman(at)greenplum(dot)com> writes:
> > > Just noticed buffile.c:292 doesn't look quite right where
> > > BufFileDumpBuffer calls FileWrite:
> > > bytestowrite = FileWrite(thisfile, file->buffer, bytestowrite);
> > > It looks as though it would write the same data each time the
> > > loop is iterated. Would this be better?
> > > bytestowrite = FileWrite(thisfile, file->buffer + wpos, bytestowrite);
> >
> > Yeah, I think you're right. We've probably not seen this because in
> > most usages the buffer is always block-aligned, but it looks possible
> > for tuplestore.c to get out of alignment if its concurrent write/read
> > feature is exercised just so. Do you want to try demonstrating the bug
> > with a smaller-than-normal setting of MAX_PHYSICAL_FILESIZE?

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2007-05-17 07:32:27 Re: Not ready for 8.3
Previous Message Greg Smith 2007-05-17 03:50:26 Re: Not ready for 8.3