Re: fallocate / posix_fallocate for new WAL file creation (etc...)

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Greg Smith <greg(at)2ndQuadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fallocate / posix_fallocate for new WAL file creation (etc...)
Date: 2013-05-30 11:17:17
Message-ID: 20130530111717.GH4201@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-05-30 06:55:16 -0400, Greg Smith wrote:
> On 5/30/13 6:49 AM, Robert Haas wrote:
> >On Wed, May 29, 2013 at 10:42 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> >>So we don't even know whether we can read. I think that means we need to
> >>zero the file anyway...
> >
> >Surely this is undue pessimism.
>
> There have been many occasions where I've found the Linux kernel defining
> support for POSIX behavior with a NOP stub that basically says "we should
> make this work one day". I don't know whether the fallocate code is one of
> those or a fully implemented call. Based on that history, until I see a
> reader that validates the resulting files are good I have to assume they're
> not.

That argument in contrast I find not very convincing though. What was
the last incidence of such a system call that did not just error out
with ENOTSUPP or such?

The linux fallocate call is fully specified for this behaviour and got
added 2.6.23, there wasn't a stub before, so I am far less worried about
it than about the underspecifiedness of posix_fallocate(). Also, if some
system call doesn't follow its documented specifications it's not fully
our problem anymore. If we rely on undocumented behaviour though...

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-05-30 11:42:25 extensible external toast tuple support
Previous Message Andres Freund 2013-05-30 11:13:13 Re: fallocate / posix_fallocate for new WAL file creation (etc...)